PX4/Firmware — pull request #553 by DrTon (2013-12-15 19:14:20+00:00)
Title: Vector attitude and position control

This is fully vector attitude and position controller. Tested in HIL (jMAVSim), not tested in flight yet. WIP but ready for very careful testing.

Attitude controller (mc_att_control_vector)
---
Initially attitude controller based on article "Minimum Snap Trajectory Generation and Control for Quadrotors", http://www.seas.upenn.edu/~dmel/mellingerICRA11.pdf. But now it reviewed and should have better performance on simultaneous large roll/pitch and yaw changes.

Attitude controller uses rotation matrix as setpoint, but can also use euler angles if rotation matrix not defined, for backward compatibility. It can work in any orientation and should handle 3D acrobatic maneures.

Rate controller is PD, attitude controller is P. Integrals not implemented yet.

Parameters are consistent with previous controller, no tuning required.

Position controller (multirotor_pos_control)
---
Position controller also rewritten to use more clear dynamics. Outer loop position controllers generate desired velocity and inner controller calculates desired acceleration == thrust vector. After thrust vector limiting attitude setpoint rotation matrix calculated from thrust vector and desired yaw. Vertical component of thrust vector has higher priority when limiting occures, to make sure copter will not loose altitude bacause of very aggressive horizontal acceleration. It's possible to tune position controller in way, where vehicle will be flipped upside down for large downside acceleration. Safe mode with limited tilt is also possible. Roll / pitch / yaw setpoint generated only for logging and control, alltitude controller uses rotation matrix directly.

Position controller is PID, velocity controller is PI.

Parameters are consistent with previous version, but some tuning may be required.