Custom G27 controller programming

Going to read all of this soon but the way I believe the auto calibration works by means of thought-experiment and because of my background in software development and logic:

Because of the calibration wheel / encoder and how it ties into the board.. software can read the value of the hardware thereby seeing if it is moving, and how fast it is moving and the direction it is moving via positive and negative values; And since we don't have flawless potentiometers, encoders, etc.. the value will fluctuate ( look at raw data of any joystick, etc.. in joy.cpl under calibration and you'll see that axis will float around the value instead of being 100% steady )..

So, in order to detect an end-point, we use time and rotation ie ▲Value from the previous value and knowing the script execution time using ▲Time we can determine speed of rotation ( if necessary you can grab the wheel size and determine speed in m/s or whatever ) taking into account the accuracy ( which can be attained by recording the range of how much it floats when at stand-still to correct the ▲ ).. During calibration, the movement is pretty quick so you can leave out quite a bit, you really only need to record the ▲Value and once it falls below a certain speed, you've hit the end-point.


Next, for auto calibration ( I'll be coding this on an STM 32 controller I got off eBay from China [ STM32F103C8T6 ] for testing and development in addition to updating the software for [ https://www.gtplanet.net/forum/threads/diy-logitech-g25-g27-shifter-pedals-usb-adapter.349367/ ] to add this feature the way I describe it...

This is actually very simple... Note: The inaccuracy / floating range should also be recorded and kept accessible referenced by a variable... Record the lowest value of the pedal, or wheel and the highest. Add half the inaccuracy range to the low, and subtract from the high - may need to use entire range. If you have a negative value for low, add the absolute value of itself to low and high. Now you have a good range to use... Current Value / MAX == 0 - 1 modifier. modifier * maximum_range for reporting to windows ( could be 32k or something else )...

You can always track high and low so it dynamically adjusts; so if the user puts a physical stop in the pedals so they can only be pressed half-way ( for whatever reason ) then that half-range will still work as 0-100% until they press it all the way down. So auto calibration is as easy as pressing each pedal all the way and releasing it, same with steering wheel...

This has many benefits.. For example a person with a disability which prevents them from bending their limbs all the way or extending or moving at the ankle fully will be able to play without hurting themselves because they can use 0-100% range based on what they are comfortable with. Additionally, you won't have to manually calibrate in windows joy.cpl panel any-more - and since you monitor min / max all the time, if the value for min / released vs depressed vs turned, etc.. change, you can float the value that direction...

In case it isn't obvious; the code to do this is very simplistic and the benefits are wide-reaching.
 
Back