afry-south / dragonfly-fcb

ÅF Dragonfly Quadrotor UAV Project
Other
7 stars 3 forks source link

PID control design/tuning #118

Open stenbergd opened 8 years ago

stenbergd commented 8 years ago
stenbergd commented 8 years ago

Tuning according to litterature found here: http://lup.lub.lu.se/luur/download?func=downloadFile&recordOId=4610294&fileOId=4610295

Restructuring PID algorithm on parallell form

stenbergd commented 8 years ago

Hopefully a decent starting controller for now using PD for roll/pitch and P for yaw rate.

PD essential to stabilize absolute angle, else it would be unstable/oscillating. Since it is a double-integrator system there are two poles needing both P and D parts to even be theoretically possible.

P used for yaw rate since its system is only a single integral.

Looking forward, integral action can be involved but let's keep it simple for now.

Here's an example of the roll/pitch tuning step response from Scilab: http://postimg.org/image/gwotvfknl/

stenbergd commented 8 years ago

We will eventually need a yaw ANGLE controller when UAV is run in autopilot/autonomous mode. When implementing this, care must be taken at the +180 / -180 degree wrap-around so that this doesn't cause large incorrect control errors.

stenbergd commented 8 years ago

Implement dynamic sample time calculated based on last control update time. Take care to init the last update time each time PID flight mode starts.

stenbergd commented 8 years ago

Fix: Increase N value for controllers significantly to allow correct D-part control (up to maybe 1000 from 15)

TODO: Document control of second order system with P, PD, PID using pole placement for optimal response (critical damping)

stenbergd commented 8 years ago

Control still suffers from some oscillations and gets out of control when larger control actions are applied.

Fixing instability:

Other

Yaw Control Update (create separate issue?)

Yaw control should perhaps no longer control the yaw rate, but the yaw angle. RC controller input should integrate the yaw stick action to generate reference yaw angle. This will need some logic, e.g. the reference starting in the start up direction, keeping track of +/- 180 deg transition as well as making sure the quadcopter yaw-rotates the correct direction (e.g. along stick movement direction, otherwise a large step could rotate to the nearest yaw location rather than taking the desired direction). Also, the calculation of control error aroung the +/-180 needs to be taken care of.

Yaw will likely need integral control action

See Brescianis quadrotor Helicopter work for reference: http://www.control.lth.se/documents/2008/5823.pdf

Documentation

Document the PID control algorithm and tuning principles. Include discretization, discussion on second-order system damping, pole-placement, some diagrams/plots. Closed-loop response: P / (s² + D*s + P)