/dist/images/branding/favicon

MK compass calibration complete reset

Discussion in 'Electronics' started by Steve Maller, Feb 3, 2013.

  1. Steve Maller

    Steve Maller UAV Grief Counselor

    Joined:
    Oct 30, 2012
    Messages:
    3,981
    Likes Received:
    807
    Ziggy from Mikrokopter.us posted this in their forum. Andy, it should be easy to find this in the source code to verify it it's actually true. It sounds plausible...

    http://www.mikrokopter.us/the-software/something-not-to-do/msg42982/

    Hey Guys,
    I found something interesting the other day, Never to Old to learn I guess.
    If you are going to do the compass Calibration and you hold the left stick upper left and the Right stick bottom Right, (instead of straight down) it will reset the board back to default settings.. I have not seen this documented but thats what happens.
    this can also happen if you lay your radio down upside down and the stick move in those directions..
    any way something to watch out for..
     
  2. Andy Johnson-Laird

    Andy Johnson-Laird Administrator
    Staff Member

    Joined:
    Jul 31, 2012
    Messages:
    10,383
    Likes Received:
    1,164
    I've look in the FC source code. The relevant code for setting the parameters sets is in file fc.c at line 869.
    I can see the logic for selecting parameter sets (and it's limited to sets 1 to 5).
    I cannot find the logic that does the reset to defaults (the equivalent of clicking on the exclamation mark in the red triangle at the bottom of the MK Tool window.

    I don't dispute what Ziggy says -- the effect is apparently real, but I can't find the code.
    As you can see it's written in C, but with German comments and variable names.

    I'll keep looking for it as I was curious where the sensing of the stick positions for selecting parameter sets was being done.

    Andy.

    ----

    fc.c lines 869 et seq. (The "setting" value is the parameter set that will be selected by SetActiveParamSet.)


    / +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    // auf Nullwerte kalibrieren
    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) // Neutralwerte
    {
    if(++delay_neutral > 200) // nicht sofort
    {
    #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
    SpeakHoTT = SPEAK_CALIBRATE;
    #endif
    delay_neutral = 0;
    modell_fliegt = 0;
    if(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70 || abs(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]]) > 70)
    {
    unsigned char setting=1;
    if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 1;
    if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] > 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 2;
    if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] < 70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 3;
    if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > 70) setting = 4;
    if(PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] <-70 && PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < 70) setting = 5;
    SetActiveParamSet(setting); // aktiven Datensatz merken
     
  3. Dave King

    Dave King Well-Known Member

    Joined:
    Dec 24, 2012
    Messages:
    2,712
    Likes Received:
    311
    Interesting. Thanks for looking into it.
     

Share This Page