paparazzi/paparazzi — Issue #85: clear definition of signs for control gains
Author: flixr
Created: 2011-11-08 09:42:30+00:00
State: open
Labels: Airborne

Currently signs for control gains are a totally inconsistent... some gains you have to set with the negative sign in the airframe file, for some the negative sign (of the feedback loop) is set in the code. e.g.:

* PITCH_DGAIN has to be set with __positive__ sign for `````` (stabilization_attitude.c:449)
* PITCH_DGAIN has to be set with __negative__ sign for `````` (stabilization_adaptive.c:419)

__We should at least be consistent about this!!__

One way to solve this without braking configurations would be to

* Always define/set the gains with a positive sign and set the correct sign in the code
* Use absolute value of the defines when initializing the gains:

```C
#define ABS(val) ((val) < 0 ? -(val) : (val))
h_ctl_pitch_dgain = ABS(H_CTL_PITCH_DGAIN);
```