Acro trainer
commit9b43839052d8930c068842639df9bfb4c87d7339
authorBruce Luckcuck <github@etracer.net>
Tue, 27 Mar 2018 12:37:39 +0000 (27 08:37 -0400)
committerBruce Luckcuck <github@etracer.net>
Wed, 30 May 2018 01:08:16 +0000 (29 21:08 -0400)
treed2a42fc97fef8fe1b4f83f4dce374cc6c4739073
parenteecb59db4542cbf577bedf853d8b314422825dae
Acro trainer
Adds a new angle limiting mode for pilots who are learning to fly in acro mode. Primarily targeted at new LOS acro pilots, but can be used with FPV as well.

The feature is activated with a new mode named "ACRO TRAINER". When the feature is active, the craft will fly in normal acro mode but will limit roll/pitch axes so that they don't exceed the configured angle limit. New pilots can start with a small angle limit and progressively increase as their skills improve.

The accelerometer must be enabled for the feature to be configured and function.

Also the feature will only be active while in acro flight and will disable if ANGLE or HORIZON modes are selected.

For most users all they need to do is simply configure the new mode to be active as desired on the "Modes" tab in the configurator and configure the desired angle limit in the cli.

Configuration parameters:

acro_trainer_angle_limit: (range 10-80) Angle limit in degrees.

acro_trainer_lookahead_ms: (range 10-200) Time in milliseconds that the logic will "look ahead" to help minimize overshoot and bounce-back if the limit is approached at high gyro rates. The default value of 50 should be good for most users. For low powered or unresponsive craft (micros or brushed) it may be helpful to increase this setting if you're seeing substantial overshoot.

acro_trainer_debug_axis: (ROLL, PITCH) The axis that will log information if debugging is active.

To enable debugging:
set debug_mode = ACRO_TRAINER

debug(0) - Current angle
debug(1) - The internal logic state
debug(2) - Modified setpoint
debug(3) - Projected angle based gyro rate and lookahead period
src/main/build/debug.c
src/main/build/debug.h
src/main/fc/fc_core.c
src/main/fc/rc_modes.h
src/main/flight/pid.c
src/main/flight/pid.h
src/main/interface/msp_box.c
src/main/interface/settings.c
src/main/interface/settings.h
src/main/target/common_fc_pre.h