Subversion Repositories FlightCtrl

Rev

Rev 1980 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1980 Rev 1986
Line 312... Line 312...
312
 
312
 
313
    if ((maxControl[PITCH] > 64) || (maxControl[ROLL] > 64)) { // reduce effect during stick commands. Replace by controlActivity.
313
    if ((maxControl[PITCH] > 64) || (maxControl[ROLL] > 64)) { // reduce effect during stick commands. Replace by controlActivity.
314
      permilleAcc /= 2;
314
      permilleAcc /= 2;
315
      debugFullWeight = 0;
315
      debugFullWeight = 0;
-
 
316
    */
Line 316... Line 317...
316
    */
317
    uint8_t ca = controlActivity >> 8;
317
 
318
 
318
    if (controlActivity > 10000) { // reduce effect during stick control activity
319
    if (ca > staticParams.maxControlActivity) { // reduce effect during stick control activity
319
      permilleAcc /= 4;
320
      permilleAcc /= 4;
320
      debugOut.digital[1] |= DEBUG_ACC0THORDER;
321
      debugOut.digital[1] |= DEBUG_ACC0THORDER;
321
      if (controlActivity > 20000) { // reduce effect during stick control activity
322
      if (controlActivity > staticParams.maxControlActivity*2) { // reduce effect during stick control activity
322
        permilleAcc /= 4;
323
        permilleAcc /= 4;
323
        debugOut.digital[1] |= DEBUG_ACC0THORDER;
324
        debugOut.digital[1] |= DEBUG_ACC0THORDER;
Line 338... Line 339...
338
      correctionSum[axis] += angle[axis] - temp;
339
      correctionSum[axis] += angle[axis] - temp;
339
    }
340
    }
340
  } else {
341
  } else {
341
    debugOut.analog[9] = 0;
342
    debugOut.analog[9] = 0;
342
    debugOut.analog[10] = 0;
343
    debugOut.analog[10] = 0;
343
 
-
 
344
    // experiment: Kill drift compensation updates when not flying smooth.
344
    // experiment: Kill drift compensation updates when not flying smooth.
345
    // correctionSum[PITCH] = correctionSum[ROLL] = 0;
345
    // correctionSum[PITCH] = correctionSum[ROLL] = 0;
346
  }
346
  }
347
}
347
}
Line 391... Line 391...
391
        accVector = temp * temp;
391
        accVector = temp * temp;
392
        temp = filteredAcc[1]/4;
392
        temp = filteredAcc[1]/4;
393
        accVector += temp * temp;
393
        accVector += temp * temp;
394
        temp = filteredAcc[2]/4;
394
        temp = filteredAcc[2]/4;
395
        accVector += temp * temp;
395
        accVector += temp * temp;
396
        debugOut.analog[19] = accVector;
396
        debugOut.analog[18] = accVector;
-
 
397
    debugOut.analog[19] = dynamicParams.maxAccVector;
397
}
398
}
Line 398... Line 399...
398
 
399
 
399
/************************************************************************
400
/************************************************************************
400
 * Main procedure.
401
 * Main procedure.