ArduCopterMega 2

Oscillations

When the dampener maximum is fixed (ie made independent of P) and both P and I are set to zero and D is big then the quad resists slow tilt changes, however fast tilting does not show any resistance.

PID


In stable mode the D is always zero, instead the STABILIZE_ROLL_D is used by the dampener which tries to stop the quad from rotating

I have made some changes to allow setting all values through the CLI. In setup.h, function setup_pid, change the following if clause:

else if (!strcmp_P(argv[1].str, PSTR("stabilize"))) {
g.pid_stabilize_roll.kP(argv[2].f);
g.pid_stabilize_pitch.kP(argv[2].f);
g.pid_stabilize_roll.kI(argv[3].f);
g.pid_stabilize_pitch.kI(argv[3].f);
g.stabilize_dampener.set_and_save(argv[4].f);

g.pid_stabilize_roll.save_gains();
g.pid_stabilize_pitch.save_gains();
}

To use it go into CLI mode, type setup, then type "pid stabilize P I D" with P, I, D replaced by the desired values.
Comments