Subversion Repositories FlightCtrl

Rev

Rev 2160 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2160 Rev 2164
Line 291... Line 291...
291
      deltaCorrection = (correctionSum[axis] + round) / DRIFTCORRECTION_TIME;
291
      deltaCorrection = (correctionSum[axis] + round) / DRIFTCORRECTION_TIME;
292
      // Add the delta to the compensation. So positive delta means, gyro should have higher value.
292
      // Add the delta to the compensation. So positive delta means, gyro should have higher value.
293
      driftComp[axis] += deltaCorrection / IMUConfig.driftCompDivider;
293
      driftComp[axis] += deltaCorrection / IMUConfig.driftCompDivider;
294
      CHECK_MIN_MAX(driftComp[axis], -IMUConfig.driftCompLimit, IMUConfig.driftCompLimit);
294
      CHECK_MIN_MAX(driftComp[axis], -IMUConfig.driftCompLimit, IMUConfig.driftCompLimit);
295
      // DebugOut.Analog[11 + axis] = correctionSum[axis];
295
      // DebugOut.Analog[11 + axis] = correctionSum[axis];
296
      debugOut.analog[6 + axis] = correctionSum[axis];
296
      debugOut.analog[18 + axis] = correctionSum[axis];
297
      debugOut.analog[13 + axis] = driftComp[axis];
297
      debugOut.analog[13 + axis] = driftComp[axis];
298
      correctionSum[axis] = 0;
298
      correctionSum[axis] = 0;
299
    }
299
    }
300
  }
300
  }
301
}
301
}