Jump to content
The simFlight Network Forums

Setting Joystick Calibration Midpoint Output for Reverse Zone?


pilotjohn

Recommended Posts

I'm using FSUIPC Joystick Calibration with a reverse zone on the mixture (e.g. detent). This works well for some turbine aircraft, however the Kodiak is a little bit different. The cutoff is 0 and low idle seems to be some small positive value, so the normal midpoint output of 8192 at the detent of my mixture is not low idle in the aircraft (but much higher). Is there an easy way to set what the "out" midpoint should be when the axis is in the "detent" zone of the calibration, as opposed to assuming an even split?

Link to comment
Share on other sites

It sounds like you want to calibrate the lower part of the throttle axis differently than the rest of the range...The only way you could do this would be using a lua script. You can assign your throttle axis value to an FSUIPC offset, have a lua script monitor that offset to get the value and then send on the required value to the FS.

John

Link to comment
Share on other sites

2 hours ago, John Dowson said:

It sounds like you want to calibrate the lower part of the throttle axis differently than the rest of the range...The only way you could do this would be using a lua script. You can assign your throttle axis value to an FSUIPC offset, have a lua script monitor that offset to get the value and then send on the required value to the FS.

John

Is it possible to adjust the output of the calibrated value in Lua before it's sent to the sim? This would seem the simplest since I know what the nominal midpoint is.

Or, is it possible to get access to the calibration points in the Lua? These are useful to know where the detent area is.

Or, better yet 🙂, would it be possible to add an advanced setting in the calibration area where the midpoint could be set/overridden?

Link to comment
Share on other sites

2 hours ago, pilotjohn said:

Is it possible to adjust the output of the calibrated value in Lua before it's sent to the sim?

This question doesn't make sense... If you are reading the joystick axis value from an offset, this is just a raw value which you will calibrate and adjust yourself. It will not go through DSUIPC calibration. That is the whole point of doing it this way - you get the raw axis value, adjust/calibrate to your needs, and then send it the the FS.

2 hours ago, pilotjohn said:

Or, is it possible to get access to the calibration points in the Lua? These are useful to know where the detent area is.

You will just get the axis value. It is up to you to know what that value is and what to do with it....you can kif the value received, to see what that is when the position is at (or around) the detent position.

2 hours ago, pilotjohn said:

Or, better yet 🙂, would it be possible to add an advanced setting in the calibration area where the midpoint could be set/overridden?

Certainly not! It is not just a midpoint - what you are asking is for is in effect two distinct calibration settings for different ranges on one axis. The facilities provided should be fine for most aircraft and hardware. We provide the additional functionality that allows you to do almost anything, but it up to you to implement this. 

Link to comment
Share on other sites

4 minutes ago, John Dowson said:

You will just get the axis value. It is up to you to know what that value is and what to do with it....you can kif the value received, to see what that is when the position is at (or around) the detent position.

The calibration values are useful to know where the raw axis top/bottom/detents are. Without access to these programmatically, I have to hard-code them in a Lua (and thus they will be in 2 places, the INI - which can change when I recalibrate occasionally, and some script - which I have to remember to update). For my use case, the only thing I need is a different lerp below/above the detent, but it would be useful to have access to the existing calibration values, even when I'm not using the calibration itself.

The midpoint is really the only thing that changes in this setup, and this seems to be hardcoded for these axes currently.

Can a monitoring Lua be profile specific?

Link to comment
Share on other sites

12 minutes ago, pilotjohn said:

The calibration values are useful to know where the raw axis top/bottom/detents are. Without access to these programmatically, I have to hard-code them in a Lua (and thus they will be in 2 places, the INI - which can change when I recalibrate occasionally, and some script - which I have to remember to update).

But this is not the case...if you are sending an axis value to an FSUIPC offset, then there is no calibration in FSUIPC. That is up to you. You also need to determine the max/min values od the axis that you use in the lua script, as the values you read will be raw input values, that completely depend on the hardware and drivers used (e.g. for certain older devices/hardware it could be a range of -128 to +128!).

17 minutes ago, pilotjohn said:

The midpoint is really the only thing that changes in this setup, and this seems to be hardcoded for these axes currently.

The midpoint of an axis that goes from 0 to 16384 is 8192... what you seem to be asking is to calibrate your axis from 0-8192 to send 0-5000 (for example), and then the values from 8192-16384 to send 5000 - 16384. This is, in effect, two distinct calibration settings for different axes ranges If you want to do such things, then this is easily achievable using lua, but you also need to know (i.e. hard-code) the minimum/maximum axis values, as well as the midpoint. I am not going to look into adding such facilities into the UI - it is already over-complicated for most users.

45 minutes ago, pilotjohn said:

Can a monitoring Lua be profile specific?

Not sure what 'a monitoring Lua' means ... a lua file/plugin is a lua file, and they can be ran (auto-started) as profile specific or not.

Link to comment
Share on other sites

Thanks, I'll try with the Lua hard-coding the calibration values (these are same regardless of profile since it's the same joystick).

My, perhaps simple, thought was that the only thing that changes in this calculation is the output midpoint (since you're already calibrating the 2 ranges differently since the detent is not guaranteed to be at the middle of the raw input range):

  • Ri = Raw input
  • Rmin = Raw minimum (as set)
  • Rmax = Raw maximum (as set)
  • Rmindet = Raw min detent (as set)
  • Rmaxdet = Raw max detent (as set)
  • Omin = Min output (e.g. documented as 0)
  • Omid = Midpoint (e.g. currently constant as 8192, but since this is up to aircraft developers whims, could be 256 - as set - in my example, the Kodiak)
  • Omax = Max output (e.g. documented as 16383)

So something like:

  • if Ri < Rmindet: return lerp Rmin:Rmindet -> Omin-Omid
  • else if Ri > Rmaxdet: return lerp Rmaxdet:Rmax -> Omid-Omax
  • else return Omid

But maybe I'm missing some other complexity somewhere. I definitely wasn't suggesting a UI change.

I think a profile specific Lua will be fine. Thanks again for talking through it.

Link to comment
Share on other sites

Ahhh...sorry, I was missing the point here....thought you were talking about the throttle axis for some reason, not the mixture....

For the mixture, can you not just calibrate this on the 4th page of the calibration screen (and assign to mixture1, not mixture). With a reverse zone, you can set the range for the idle zone - it defaults to 8192 but you should be able to set/change this to whatever values you need....so the default would be:

image.png.fb43907fc77eda73c4ec25f7b9d5492c.png

and you can calibrate/change to something like (for around 256):

image.png.c03b7b1d30f9fe2d1b175e24bcf94091.png

?

This is only available on the individual mixture controls - you can map the mixture control to the 4 mixture controls and calibrate there.

John

Link to comment
Share on other sites

So the challenge is that the 8192 output is wherever I set the "detent" min/max. I'm using a Virtual Fly TQ6+, for which the detent (physical notch) I calibrated around raw input of -11000 .. -9500. This is the range where I would like an "out" of 256 (or whatever) instead of 8192. Currently FSUIPC calibration is already doing 2 lerps; one for below the detent and one for above the detent, with 8192 as the midpoint of the output (in my case for the TQ6+ this looks like):

  • -16250 .. -11000 -> 0 .. 8192 (~5000 range -> ~8000 range)
  • -9500 .. 16250 -> 8192 .. 16383 (~26000 range -> ~8000 range)

What I'm trying to do is to get this instead:

  • -16250 .. -11000 -> 0 .. 256 (~5000 range -> ~250 range)
  • -9500 .. 16250 -> 256 .. 16383 (~26000 -> ~15750 range)

This what I meant by making the "midpoint" settable for the output (wherever you lerp with 8192, instead it would be some setting).

I can do this in Lua, I was just hoping it would be easy to add some extension to the calibration INI settings to have this 8192 be custom.

I can also probably make this work with ranges for the Kodiak.

Anyway, no worries, the discussion is helpful.

 

Link to comment
Share on other sites

Could you log Axes Controls and let me know the output values you see when you move the mixture lever. I have tested here and see that
   - any value above -16186 or so moves the mixture out of cut-off to low idle
   - values between -16186 and +16000 (or so) are shown when moving the lever between the low idle zone
   - values above +16000 are high idle

So, if any small increment above -16383 moves the lever from cut-off to low idle, to allow more movement until low idle is achieved, you should be able to set the min value to just below your detent. HOWEVER,  when I try this here the calibration minimum seems to be completely ignored.... not sure why this is at the moment. I will look into this (when time permits, I have a lot of things to look into at the moment...), but would like to know if you see the same. Maybe you could also attach your FSUIPC7.ini so that I can see your actual assignments.

John

Link to comment
Share on other sites

1 hour ago, John Dowson said:

Could you log Axes Controls and let me know the output values you see when you move the mixture lever. I have tested here and see that
   - any value above -16186 or so moves the mixture out of cut-off to low idle
   - values between -16186 and +16000 (or so) are shown when moving the lever between the low idle zone
   - values above +16000 are high idle

I should say that this is what I see with my assignments using Axis Mixture1 Set.
When I move the mixture in the VC, I see Mixture 1 Set events where:
    - < 164 is cut-off
    - between 164 and 16064 is low idle
    - >16064 is high idle

So, switching to assigning with Send to FSUIPC as normal axis, and using Mixture Set and unchecking Exclude MIXTUREn_SET and with No reverse zone checked, I can then set the minimum axis position, Setting this to just below your detent should give cut-off in the range before your detent, and then low/high idle for the rest if the axis range. This is basically what you are trying to achieve, no?

John

 

Link to comment
Share on other sites

21 minutes ago, John Dowson said:

I should say that this is what I see with my assignments using Axis Mixture1 Set.
When I move the mixture in the VC, I see Mixture 1 Set events where:
    - < 164 is cut-off
    - between 164 and 16064 is low idle
    - >16064 is high idle

So, switching to assigning with Send to FSUIPC as normal axis, and using Mixture Set and unchecking Exclude MIXTUREn_SET and with No reverse zone checked, I can then set the minimum axis position, Setting this to just below your detent should give cut-off in the range before your detent, and then low/high idle for the rest if the axis range. This is basically what you are trying to achieve, no?

John

 

I see what you're doing ... yes this works well. I set it up with a range and that worked also, but this is better, thanks.

It's a little confusing, since I'm not sending it to calibration, but calibration is still being applied, right?

The minimum calibration seems to be working fine.

[Axes]
RangeRepeatRate=10
0=CX,16,D,3,0,0,0	-{ DIRECT: Rudder }-
1=CU,16,D,7,0,0,0	-{ DIRECT: LeftBrake }-
2=CV,16,D,8,0,0,0	-{ DIRECT: RightBrake }-
3=EX,16,D,9,0,0,0	-{ DIRECT: Throttle1 }-
4=EY,16,D,10,0,0,0	-{ DIRECT: Throttle2 }-
5=EZ,16,D,17,0,0,0	-{ DIRECT: PropPitch1 }-
6=EU,16,D,18,0,0,0	-{ DIRECT: PropPitch2 }-
7=EV,16,F,65919,0,0,0	-{ TO SIM: MIXTURE1_SET }-
8=DX,16,D,1,0,0,0	-{ DIRECT: Aileron }-
9=DY,16,D,2,0,0,0	-{ DIRECT: Elevator }-

[JoystickCalibration]
AllowSuppressForPFCquad=Yes
ExcludeThrottleSet=Yes
ExcludeMixtureSet=No
ExcludePropPitchSet=Yes
SepRevsJetsOnly=No
ApplyHeloTrim=No
UseAxisControlsForNRZ=No
MapThr12to34=Yes
MapProp12to34=Yes
MapMix12to34=Yes
FlapsSetControl=0
FlapDetents=No
ReverserControl=66292
Reverser1Control=66422
Reverser2Control=66425
Reverser3Control=66428
Reverser4Control=66431
MaxThrottleForReverser=256
AileronTrimControl=66731
RudderTrimControl=66732
CowlFlaps1Control=66162
CowlFlaps2Control=66163
CowlFlaps3Control=66164
CowlFlaps4Control=66165
SteeringTillerControl=0
MaxSteerSpeed=60
RudderBlendLowest=1
Aileron=-16256,-31,31,16256
SlopeAileron=2
Elevator=-16256,-15,15,16256
SlopeElevator=1
Rudder=-16256,-63,63,16256
SlopeRudder=4
LeftBrake=-16256,16256/16
RightBrake=-16256,16256/16
Throttle1=-15548,-2812,184,16169
Throttle2=-16052,-2883,243,16195
Mixture1=-10541,-10541,-9116,16079/32
Mixture2=-16248,-11357,-9004,16159/32
PropPitch1=-16184,-11037,-9196,15991
PropPitch2=-16184,-11357,-9581,16015

Here's the log:

922062 ***  AXIS: Cntrl= 65763 (0x000100e3), Param= -256 (0xffffff00) AXIS_AILERONS_SET
   922125 ***  AXIS: Cntrl= 65763 (0x000100e3), Param= -249 (0xffffff07) AXIS_AILERONS_SET
   925000 ***  AXIS: Cntrl= 65763 (0x000100e3), Param= -256 (0xffffff00) AXIS_AILERONS_SET
   925031 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 16369 (0x00003ff1) MIXTURE1_SET
   925062 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 16241 (0x00003f71) MIXTURE1_SET
   925062 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 16068 (0x00003ec4) MIXTURE1_SET
   925093 ***  AXIS: Cntrl= 65763 (0x000100e3), Param= -249 (0xffffff07) AXIS_AILERONS_SET
   925093 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 15857 (0x00003df1) MIXTURE1_SET
   925109 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 15606 (0x00003cf6) MIXTURE1_SET
   925156 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 15310 (0x00003bce) MIXTURE1_SET
   925171 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 14970 (0x00003a7a) MIXTURE1_SET
   925203 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 14596 (0x00003904) MIXTURE1_SET
   925234 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 14207 (0x0000377f) MIXTURE1_SET
   925234 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 13808 (0x000035f0) MIXTURE1_SET
   925265 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 13400 (0x00003458) MIXTURE1_SET
   925281 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 12986 (0x000032ba) MIXTURE1_SET
   925312 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 12577 (0x00003121) MIXTURE1_SET
   925328 ***  AXIS: Cntrl= 65763 (0x000100e3), Param= -256 (0xffffff00) AXIS_AILERONS_SET
   925328 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 12174 (0x00002f8e) MIXTURE1_SET
   925375 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 11760 (0x00002df0) MIXTURE1_SET
   925390 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 11352 (0x00002c58) MIXTURE1_SET
   925421 ***  AXIS: Cntrl= 65763 (0x000100e3), Param= -249 (0xffffff07) AXIS_AILERONS_SET
   925421 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 10948 (0x00002ac4) MIXTURE1_SET
   925453 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 10549 (0x00002935) MIXTURE1_SET
   925468 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 10155 (0x000027ab) MIXTURE1_SET
   925500 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 9762 (0x00002622) MIXTURE1_SET
   925500 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 9373 (0x0000249d) MIXTURE1_SET
   925531 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 8979 (0x00002313) MIXTURE1_SET
   925546 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 8585 (0x00002189) MIXTURE1_SET
   925578 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 8196 (0x00002004) MIXTURE1_SET
   925593 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 7807 (0x00001e7f) MIXTURE1_SET
   925625 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 7423 (0x00001cff) MIXTURE1_SET
   925640 ***  AXIS: Cntrl= 65763 (0x000100e3), Param= -256 (0xffffff00) AXIS_AILERONS_SET
   925656 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 7039 (0x00001b7f) MIXTURE1_SET
   925671 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 6655 (0x000019ff) MIXTURE1_SET
   925703 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 6271 (0x0000187f) MIXTURE1_SET
   925734 ***  AXIS: Cntrl= 65763 (0x000100e3), Param= -249 (0xffffff07) AXIS_AILERONS_SET
   925734 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 5891 (0x00001703) MIXTURE1_SET
   925750 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 5522 (0x00001592) MIXTURE1_SET
   925765 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 5152 (0x00001420) MIXTURE1_SET
   925796 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 4802 (0x000012c2) MIXTURE1_SET
   925812 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 4462 (0x0000116e) MIXTURE1_SET
   925843 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 4137 (0x00001029) MIXTURE1_SET
   925875 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 3837 (0x00000efd) MIXTURE1_SET
   925890 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 3556 (0x00000de4) MIXTURE1_SET
   925921 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 3305 (0x00000ce9) MIXTURE1_SET
   925937 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 3073 (0x00000c01) MIXTURE1_SET
   925968 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 2857 (0x00000b29) MIXTURE1_SET
   925984 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 2645 (0x00000a55) MIXTURE1_SET
   926015 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 2443 (0x0000098b) MIXTURE1_SET
   926031 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 2241 (0x000008c1) MIXTURE1_SET
   926062 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 2053 (0x00000805) MIXTURE1_SET
   926093 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 1866 (0x0000074a) MIXTURE1_SET
   926109 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 1679 (0x0000068f) MIXTURE1_SET
   926140 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 1472 (0x000005c0) MIXTURE1_SET
   926156 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 1275 (0x000004fb) MIXTURE1_SET
   926171 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 1088 (0x00000440) MIXTURE1_SET
   926187 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 926 (0x0000039e) MIXTURE1_SET
   926234 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 783 (0x0000030f) MIXTURE1_SET
   926250 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 669 (0x0000029d) MIXTURE1_SET
   926281 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 576 (0x00000240) MIXTURE1_SET
   926296 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 497 (0x000001f1) MIXTURE1_SET
   926328 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 438 (0x000001b6) MIXTURE1_SET
   926359 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 398 (0x0000018e) MIXTURE1_SET
   926375 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 388 (0x00000184) MIXTURE1_SET
   927656 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 379 (0x0000017b) MIXTURE1_SET
   928781 ***  AXIS: Cntrl= 65764 (0x000100e4), Param= 96 (0x00000060) AXIS_RUDDER_SET
   928875 ***  AXIS: Cntrl= 65764 (0x000100e4), Param= 79 (0x0000004f) AXIS_RUDDER_SET
   930296 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 369 (0x00000171) MIXTURE1_SET
   930375 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 359 (0x00000167) MIXTURE1_SET
   930453 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 349 (0x0000015d) MIXTURE1_SET
   930500 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 339 (0x00000153) MIXTURE1_SET
   ... wait a few seconds to cut off ...
   930531 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 295 (0x00000127) MIXTURE1_SET
   930546 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 201 (0x000000c9) MIXTURE1_SET
   930578 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 59 (0x0000003b) MIXTURE1_SET
   930593 ***  AXIS: Cntrl= 65919 (0x0001017f), Param= 0 (0x00000000) MIXTURE1_SET

 

Link to comment
Share on other sites

10 minutes ago, pilotjohn said:

It's a little confusing, since I'm not sending it to calibration, but calibration is still being applied, right?

Yes, you can still calibrate if sending to the FS - FSUIPC receives the value back from the FS, masks it (so it isn;t applied), applies the calibration and then resends it.

No need to show me the logs/assignments if it is working....

I'm happy we got to a solution for this one!

Link to comment
Share on other sites

8 minutes ago, John Dowson said:
10 minutes ago, pilotjohn said:

Shouldn't this also just work by sending to FSUIPC for calibration then (without exclude mixture set)?

It should, but there seems to be an issue with the calibration using this method (as I mentioned above). You can try it to see if you get the same...

Just tried this again and it seems to be ok this way as well - and better as no round-trip of the axis value to the server and back required...

Not sure why this didn't work the first time I tried it this way...

John

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.