mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-21 11:54:15 +01:00
Stabilization: When in none
mode zero the integral accumulators for rate and
attitude loops. When not using outer loop zero that accumulator.
This commit is contained in:
parent
6945f17eba
commit
b38081bb1b
@ -235,6 +235,9 @@ static void stabilizationTask(void* parameters)
|
|||||||
{
|
{
|
||||||
case STABILIZATIONDESIRED_STABILIZATIONMODE_RATE:
|
case STABILIZATIONDESIRED_STABILIZATIONMODE_RATE:
|
||||||
rateDesiredAxis[i] = attitudeDesiredAxis[i];
|
rateDesiredAxis[i] = attitudeDesiredAxis[i];
|
||||||
|
|
||||||
|
// Zero attitude and axis lock accumulators
|
||||||
|
pids[PID_ROLL + i] = 0;
|
||||||
axis_lock_accum[i] = 0;
|
axis_lock_accum[i] = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -249,6 +252,8 @@ static void stabilizationTask(void* parameters)
|
|||||||
|
|
||||||
rateDesiredAxis[i] = attitudeDesiredAxis[i] + weak_leveling;
|
rateDesiredAxis[i] = attitudeDesiredAxis[i] + weak_leveling;
|
||||||
|
|
||||||
|
// Zero attitude and axis lock accumulators
|
||||||
|
pids[PID_ROLL + i] = 0;
|
||||||
axis_lock_accum[i] = 0;
|
axis_lock_accum[i] = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -314,14 +319,20 @@ static void stabilizationTask(void* parameters)
|
|||||||
case ROLL:
|
case ROLL:
|
||||||
actuatorDesiredAxis[ct] = bound(attitudeDesiredAxis[ct]);
|
actuatorDesiredAxis[ct] = bound(attitudeDesiredAxis[ct]);
|
||||||
shouldUpdate = 1;
|
shouldUpdate = 1;
|
||||||
|
pids[PID_RATE_ROLL].iAccumulator = 0;
|
||||||
|
pids[PID_ROLL].iAccumulator = 0;
|
||||||
break;
|
break;
|
||||||
case PITCH:
|
case PITCH:
|
||||||
actuatorDesiredAxis[ct] = bound(attitudeDesiredAxis[ct]);
|
actuatorDesiredAxis[ct] = bound(attitudeDesiredAxis[ct]);
|
||||||
shouldUpdate = 1;
|
shouldUpdate = 1;
|
||||||
|
pids[PID_RATE_PITCH].iAccumulator = 0;
|
||||||
|
pids[PID_PITCH].iAccumulator = 0;
|
||||||
break;
|
break;
|
||||||
case YAW:
|
case YAW:
|
||||||
actuatorDesiredAxis[ct] = bound(attitudeDesiredAxis[ct]);
|
actuatorDesiredAxis[ct] = bound(attitudeDesiredAxis[ct]);
|
||||||
shouldUpdate = 1;
|
shouldUpdate = 1;
|
||||||
|
pids[PID_RATE_YAW].iAccumulator = 0;
|
||||||
|
pids[PID_YAW].iAccumulator = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user