Merge pull request #60 from schugabe/master

Added options for further TPA configuration
This commit is contained in:
dongie 2014-04-08 06:34:52 +09:00
commit 641c6eb890
4 changed files with 7 additions and 5 deletions

View File

@ -164,6 +164,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

@ -13,7 +13,7 @@ master_t mcfg; // master config struct with data independent from profiles
config_t cfg; // profile config struct
const char rcChannelLetters[] = "AERT1234";
static const uint8_t EEPROM_CONF_VERSION = 60;
static const uint8_t EEPROM_CONF_VERSION = 61;
static uint32_t enabledSensors = 0;
static void resetConf(void);
@ -255,6 +255,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

@ -80,8 +80,6 @@ void blinkLED(uint8_t num, uint8_t wait, uint8_t repeat)
}
}
#define BREAKPOINT 1500
void annexCode(void)
{
static uint32_t calibratedAccTime;
@ -98,11 +96,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