Quadcopter control programming

Discussions about quadcopters/multi-rotors
Post Reply
vikrant8051
Beginner
Posts: 1
Joined: Tue Apr 15, 2014 12:38 pm

Quadcopter control programming

Post 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 ??
tobias
Bitcraze
Posts: 2059
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Quadcopter control programming

Post 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.
Post Reply