Page 1 of 1

Quadcopter control programming

Posted: Tue Apr 15, 2014 12:59 pm
by vikrant8051
Why in stabilizer.c file in function stabilizerTask you use two pid related functions viz;
1)controllerCorrectAttitudePID(eulerRollActual, eulerPitchActual, eulerYawActual,
eulerRollDesired, eulerPitchDesired, -eulerYawDesired,
&rollRateDesired, &pitchRateDesired, &yawRateDesired);
2)controllerCorrectRatePID(gyro.x, -gyro.y, gyro.z,
rollRateDesired, pitchRateDesired, yawRateDesired);
one after another.
Because what if we stabilize Quadcopter directly using only tilt and bank angles with PID ?What is extra need of gyroRate pid ??

I am confused in "controllerCorrectRatePID" function parameters because if we consider from roll axis point of view we are sending angular rate (gyrox) and angular error (rollRateDesired) as parameter to "pidUpadate" means this is mismatch.Since one is rate another is angle processed by pid.

What if we update motor commond depend upon tilt and bank angles only ??

Re: Quadcopter control programming

Posted: Thu Apr 17, 2014 9:27 am
by tobias
One of the benefits with a cascaded PID is that you can run them at different rates. The gyros are doing the most important stabilization and it is possible to manually fly it solely in rate mode, quite hard though :). There is a short description of the setup here.

The yaw on the other hand is in rate by default since the magnetometer, which can correct the gyro drift, is hard to calibrate and use indoors.