2D stick calibration?

More
13 Sep 2018 22:08 #70892 by brycej
2D stick calibration? was created by brycej
I've been annoyed at the calibration of the t8sg plus with hall effect gimbals. I can't seem to hit all 4 corners of each at max input after calibration. So I was thinking of doing a 2d stick calibration. Basically get all 4 corners (probably the center point of each stick as well). Then calculate the stick positions based off of that data.

Something like this in _tx_configure.c after the other calibration (Just some quick code)
       s32 horz;
        s32 vert;

        //loop through each stick
        for (u8 i = 0; i < 2; i++) {
            if (i = 0) {
                horz = CHAN_ReadRawInput(INP_RUDDER); 
                vert = CHAN_ReadRawInput(INP_THROTTLE);     
            } else {
                horz = CHAN_ReadRawInput(INP_ELEVATOR);
                vert = CHAN_ReadRawInput(INP_AILERON);      
            }    
            if ((horz < Transmitter.fullstickcalibration[i].bottomleft[0]) &&
               (vert < Transmitter.fullstickcalibration[i].bottomleft[1])) {
                Transmitter.fullstickcalibration[i].bottomleft[0] = horz;
                Transmitter.fullstickcalibration[i].bottomleft[1] = vert;
            }
            if ((horz > Transmitter.fullstickcalibration[i].bottomright[0]) &&
               (vert < Transmitter.fullstickcalibration[i].bottomright[1])) {
                Transmitter.fullstickcalibration[i].bottomright[0] = horz;
                Transmitter.fullstickcalibration[i].bottomright[1] = vert;
            }
            if ((horz < Transmitter.fullstickcalibration[i].topleft[0]) &&
               (vert > Transmitter.fullstickcalibration[i].topleft[1])) {
                Transmitter.fullstickcalibration[i].topleft[0] = horz;
                Transmitter.fullstickcalibration[i].topleft[1] = vert;
            }
            if ((horz > Transmitter.fullstickcalibration[i].topright[0]) &&
               (vert > Transmitter.fullstickcalibration[i].topright[1])) {
                Transmitter.fullstickcalibration[i].topright[0] = horz;
                Transmitter.fullstickcalibration[i].topright[1] = vert;
            }                                
        }

Any gotchas there? Mode1 vs Mode2 controls?

Please Log in or Create an account to join the conversation.

Time to create page: 0.027 seconds
Powered by Kunena Forum