Jump to content



Photo
- - - - -

Pinscaped KL25Z Accelerometer - To Calibrate or not ?


  • Please log in to reply
6 replies to this topic

#1 Tesla

Tesla

    Pinball Fan

  • Silver Supporter
  • 1,367 posts
  • Location:Texas, USA

  • Flag: United States of America

  • Favorite Pinball: Star Trek - TNG

Posted 25 February 2023 - 04:55 AM

That is the question.

 

I'm getting ready to setup my VPX-Tables to work with my KL25Z Accelerometer (running Pinscape Controller software). I heard that combo supports variable analog-nudge (so that sounds cool).

 

Only thing is, here:

http://mjrnet.org/pi...de.php?sid=tilt

 

It specifically says NOT to Calibrate it.

 

However, as I recall, it worked better with JoyToKey in TPA-Arcooda (to trigger Digital-Nudge keyboard buttons) when it WAS calibrated. 

 

https://www.vpforums...=50747&p=514028

 

I'm not asking for help with TPA or my ALP. But I was wondering ... are yall truly still NOT calibrating the KL25Z Accelerometer before use in VPX? No calibration (just Defaulted in Windows) and then just using the settings provided in VPX to "fine tune" it? 

 

And not sure if it matters, but I'm not running DOFLinx on my ALP (which is always in OTG-Mode when running VPX, TPA, etc). I don't think it matters because we are talking about an Input device.


Edited by Tesla, 25 February 2023 - 05:15 AM.


#2 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,332 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 25 February 2023 - 06:56 PM

It sounds like you've already read the build guide section on this, so you've probably already seen the rationale explained there, but I guess it bears repeating.  I know that it always seems like a good thing when there's another "optimization" you can run. But Windows joystick calibration is for joysticks, not for accelerometers.  It does completely the wrong thing with accelerometers.  It's not an optimization - it makes a mess of the data input.

 

The function of the Windows calibration is to find the extremes of the joystick deflection on each axis and make sure that the joystick covers that full range, by artificially multiplying the inputs by a scaling factor determined during calibration. This doesn't work well with accelerometers because it's not possible to smoothly move the accelerometer over its range during calibration, the way the calibration tool asks you to do.  Virtually 100% of the time, you'll end up with a calibration factor that's too high, which forces the joystick into clipping (think of an audio amplifier being overdriven - same thing), which loses information. Not only that, but the WIndows calibration applies different factors on the positive and negative sides of each axis, so not only will you force the accelerometer past its limits with the calibration, you'll do so asymmetrically, so that you get inconsistent readings left/right and forward/back.  The combination of over-amplification and the asymmetrical amplification makes the readings erratic and non-linear.  WITHOUT the Windows calibration, the readings will be perfectly linear with respect to the actual physical acceleration.

 

If that's not enough for you, the Windows calibration also tries to detect the zero point, and its estimation of that is ALWAYS wrong, because an accelerometer never sits exactly still long enough for the calibration tool to get a fix on the zero point.  It wouldn't matter even if it could get a good fix on the zero point, which it can't, because the zero point for an accelerometer naturally drifts a little over time due to small changes in the position of the cab in space.  The Windows calibration just picks a (wrong) point and then locks it in forever in your registry settings.  This will give the joystick input to Windows a constant bias that will make it seem like every table you play is set up with a short leg, tilted a bit left or right.  The Pinscape software has its own auto-zeroing that it does constantly,  and correctly (since it knows it's dealing with an accelerometer rather than a joystick).  That compensates automatically for little changes in your cab's position in space over time, as you bump and move the cabinet.  As long as you don't have Windows try to throw in its own bad data into the mix, the auto-zeroing keeps it perfectly centered when the machine is at rest.

 

(Note that VP has its own way of multiplying the joystick axis input by an amplification/attenuation factor, which it calls the GAIN.  You can find this setting in the VP keyboard/joystick setup dialog.  That one is actually useful, because it puts the gain factor directly under your control, and it applies it uniformly across the whole axis, positive and negative.  The gain factor lets you adjust the proportional strength of the acceleration response within the VP simulation.  DO adjust that to get the strength of the response to your liking.)


Edited by mjr, 25 February 2023 - 07:04 PM.


#3 Tesla

Tesla

    Pinball Fan

  • Silver Supporter
  • 1,367 posts
  • Location:Texas, USA

  • Flag: United States of America

  • Favorite Pinball: Star Trek - TNG

Posted 25 February 2023 - 09:56 PM

Well first, I really appreciate you taking the time to post such a thorough response. 

 

It's not that I need to nudge the machine a lot (or am even used to doing it) but I think this whole "accelerometer nudge" really adds to to realism of Virtual Pinball in general. It's really helpful that you and the community have put so much thought and effort into it. 

 

Yes, I did notice that after Windows calibration, the "movement" in Tester was more extreme. Without knowing what I know now, that seems like a good thing as it is easier to detect. However, an unexpected side-effect is that it takes about 1-2 seconds for the Accelerometer to settle down and recover back to neutral. This is all in-line with your findings and documentation on the matter.

 

So, I'm going to to follow your directions to the letter and try to get it working the best I can VPX. Other than the obvious benefits (especially if I can finally see variable analog nudge), I think I can then use the ALP's nudge-buttons for Magna-Save.

 

Then, without disturbing any of that, I'll circle back and try to get it working in TPA-Arcooda and Pinball-FX3 (I use JoyToKey with those). If it is possible, great. If not ... I'll just have to use the nudge buttons or just not nudge. 



#4 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,332 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 25 February 2023 - 10:11 PM

> Other than the obvious benefits (especially if I can finally see variable analog nudge),

You definitely should be able to achieve that!  It's exactly what the VP accelerometer scheme is designed for.  You might have to play around with the VP "gain" setting a little bit to find the right range, but once you do, you should see nice proportional responses.

 

> I think I can then use the ALP's nudge-buttons for Magna-Save.

 

That seems like a great use for the extra buttons, assuming they're positioned near the flipper buttons.  (If they're located somewhere else, it'll probably be tough to move fast enough to ever catch a ball with Magna Save in practice.  In that case maybe you could repurpose them for something that doesn't need such quick response times, like a Fire button or Extra Ball button.)


> Then, without disturbing any of that, I'll circle back and try to get it working

> in TPA-Arcooda and Pinball-FX3 (I use JoyToKey with those).

 

I don't know what the analog nudge situation in TPA-Arcooda or FX3 is, so I'm afraid I can't offer any input there.  Hopefully they'll be workable - analog nudging is so much more natural than buttons.



#5 Tesla

Tesla

    Pinball Fan

  • Silver Supporter
  • 1,367 posts
  • Location:Texas, USA

  • Flag: United States of America

  • Favorite Pinball: Star Trek - TNG

Posted 25 February 2023 - 11:27 PM

 

1. That seems like a great use for the extra buttons, assuming they're positioned near the flipper buttons.  

 

2. I don't know what the analog nudge situation in TPA-Arcooda or FX3 is, so I'm afraid I can't offer any input there.  Hopefully they'll be workable - analog nudging is so much more natural than buttons.

 

 

1. Yes, they are.

 

2. AFAIK, TPA only supports digital-nudge, so it ends up being "watch the joystick or accelerometer for activity and then press the keyboard button for me). Not sure if FX3 is analog or just digital.

 

Now that I've seen how nice VPX is these-days, FX3 has been dropped to 3rd favorite (plus, I don't have many tables inside it).


Edited by Tesla, 26 February 2023 - 01:23 AM.


#6 wiesshund

wiesshund

    VPF Legend

  • Members
  • PipPipPipPipPipPipPip
  • 11,871 posts

  • Flag: United States of America

  • Favorite Pinball: How many can i have?

Posted 26 February 2023 - 12:54 AM

FX3 be digital last i heard


If you feel the need to empty your wallet in my direction, i don't have any way to receive it anyways

Spend it on Hookers and Blow


#7 Tesla

Tesla

    Pinball Fan

  • Silver Supporter
  • 1,367 posts
  • Location:Texas, USA

  • Flag: United States of America

  • Favorite Pinball: Star Trek - TNG

Posted 27 February 2023 - 01:56 AM

But Windows joystick calibration is for joysticks, not for accelerometers.  It does completely the wrong thing with accelerometers.  It's not an optimization - it makes a mess of the data input.

 

WITHOUT the Windows calibration, the readings will be perfectly linear with respect to the actual physical acceleration.

 

 

 

I am pleased to report that my KL25Z Accelerometer works perfectly in VPX just like you suggested here (and on your website) as non-Calibrated (ie only Defaulted). Probably the easiest VPX configuration job I have done up to this point. 

 

Seeing the variable analog nudge working on this ALP cabinet for the first time is very cool.

 

In Pinscape Controller config, I have it set as Joystick on the (default) X,Y,Z axis.

 

The ALP's HID-Interface is also non-calibrated (Defaulted). The Plunger is also setup and working in VPX. It is also on Axis-Z but I'm not seeing any conflicts (maybe since it's a separate controller?). The ALP's (lame) on-board Accelerometer ( locked-to and reporting as Rx-Ry-Rz ) is being effectively IGNORED as desired.

 

That pretty much covers it. If yall think it might be helpful to other ALP owners going this route, I could do a dedicated post/wiki on it. I could including mounting-tips and also include my final Prefs/VPX settings screen (after I fine tune it a bit more).