PID added new dweight values
This commit is contained in:
parent
3d3d16cead
commit
428a6140b4
@ -265,7 +265,7 @@ void pidUAVcore(pidProfile_t *pidProfile, pidProfileBuff_t *pidProfileBuff,
|
||||
|
||||
|
||||
/* -----calculate P component ---- */
|
||||
float PTerm = PTERM_SCALE * rateError * pidProfile->P[axis] * pidProfile-> PIDweight[axis] / 100;
|
||||
float PTerm = PTERM_SCALE * rateError * (float)pidProfile->P[axis] * (float)pidProfile-> PIDweight[axis] / 100.0;
|
||||
|
||||
// Constrain YAW by yaw_p_limit value
|
||||
if (axis == YAW)
|
||||
@ -328,7 +328,7 @@ void pidUAVcore(pidProfile_t *pidProfile, pidProfileBuff_t *pidProfileBuff,
|
||||
delta = pt1FilterApply4(&pidProfileBuff->deltaFilter[axis], delta, pidProfile->dterm_lpf, pidProfileBuff->dT);
|
||||
}
|
||||
|
||||
DTerm = DTERM_SCALE * delta * pidProfile->D[axis] * pidProfile->PIDweight[axis] / 100;
|
||||
DTerm = DTERM_SCALE * delta * (float)pidProfile->D[axis] * (float)pidProfile->PIDweight[axis] / 100.0;
|
||||
DTerm = constrainf(DTerm, -PID_MAX_D, PID_MAX_D);
|
||||
}
|
||||
|
||||
@ -520,6 +520,8 @@ void pidUAVInit(pidProfile_t *pidProfile, uint8_t ID)
|
||||
PidProfile[ID].pidEnabled = true;
|
||||
PidProfile[ID].dterm_lpf = 90;
|
||||
PidProfile[ID].pid_out_limit = 1000;
|
||||
pidProfile[ID].PIDweight[ROLL] = 50;
|
||||
pidProfile[ID].PIDweight[PITCH] = 50;
|
||||
|
||||
break;
|
||||
case PID_ID_COMPASS:
|
||||
|
Reference in New Issue
Block a user