Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 1922 → Rev 1921

/branches/dongfang_FC_fixedwing/flight.c
139,6 → 139,7
}
/************************************************************************/
 
/* Calculate control feedback from angle (gyro integral) */
/* and angular velocity (gyro signal) */
/************************************************************************/
153,9 → 154,7
PDPartYaw = (int32_t) (yawRate * 2 * (int32_t) yawPFactor) / (256L / CONTROL_SCALING)
+ (differential[YAW] * (int16_t) dynamicParams.GyroYawD) / 16;
 
/************************************************************************/
/* Stick signals are positive and gyros are negative... */
/************************************************************************/
 
IPart[PITCH] = controlIntegrals[CONTROL_ELEVATOR] - angle[PITCH];
if (IPart[PITCH] > PITCHROLLOVER180) IPart[PITCH] -= PITCHROLLOVER360;
else if (IPart[PITCH] <= -PITCHROLLOVER180) IPart[PITCH] += PITCHROLLOVER360;