Merge remote-tracking branch 'multiwii/master' into hott-telemetry

This commit is contained in:
Dominic Clifton 2014-04-07 23:08:03 +01:00
commit c012e7480f
4 changed files with 6 additions and 4 deletions

View File

@ -168,6 +168,8 @@ const clivalue_t valueTable[] = {
{ "thr_expo", VAR_UINT8, &cfg.thrExpo8, 0, 100 },
{ "roll_pitch_rate", VAR_UINT8, &cfg.rollPitchRate, 0, 100 },
{ "yawrate", VAR_UINT8, &cfg.yawRate, 0, 100 },
{ "tparate", VAR_UINT8, &cfg.dynThrPID, 0, 100},
{ "tpa_breakpoint", VAR_UINT16, &cfg.tpaBreakPoint, 1000, 2000},
{ "failsafe_delay", VAR_UINT8, &cfg.failsafe_delay, 0, 200 },
{ "failsafe_off_delay", VAR_UINT8, &cfg.failsafe_off_delay, 0, 200 },
{ "failsafe_throttle", VAR_UINT16, &cfg.failsafe_throttle, 1000, 2000 },

View File

@ -256,6 +256,7 @@ static void resetConf(void)
cfg.rollPitchRate = 0;
cfg.yawRate = 0;
cfg.dynThrPID = 0;
cfg.tpaBreakPoint = 1500;
cfg.thrMid8 = 50;
cfg.thrExpo8 = 0;
// for (i = 0; i < CHECKBOXITEMS; i++)

View File

@ -83,8 +83,6 @@ void blinkLED(uint8_t num, uint8_t wait, uint8_t repeat)
}
}
#define BREAKPOINT 1500
void annexCode(void)
{
static uint32_t calibratedAccTime;
@ -101,11 +99,11 @@ void annexCode(void)
int i;
// PITCH & ROLL only dynamic PID adjustemnt, depending on throttle value
if (rcData[THROTTLE] < BREAKPOINT) {
if (rcData[THROTTLE] < cfg.tpaBreakPoint) {
prop2 = 100;
} else {
if (rcData[THROTTLE] < 2000) {
prop2 = 100 - (uint16_t) cfg.dynThrPID * (rcData[THROTTLE] - BREAKPOINT) / (2000 - BREAKPOINT);
prop2 = 100 - (uint16_t) cfg.dynThrPID * (rcData[THROTTLE] - cfg.tpaBreakPoint) / (2000 - cfg.tpaBreakPoint);
} else {
prop2 = 100 - cfg.dynThrPID;
}

View File

@ -165,6 +165,7 @@ typedef struct config_t {
uint8_t yawRate;
uint8_t dynThrPID;
uint16_t tpaBreakPoint; // Breakpoint where TPA is activated
int16_t mag_declination; // Get your magnetic decliniation from here : http://magnetic-declination.com/
int16_t angleTrim[2]; // accelerometer trim