Quadcopter control programming
Posted: Tue Apr 15, 2014 12:59 pm
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 ??
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 ??