Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 1866 → Rev 1867

/branches/dongfang_FC_rewrite/controlMixer.c
159,7 → 159,7
control[PITCH] = RC_PRTY[CONTROL_PITCH] + EC_PRTY[CONTROL_PITCH];
control[ROLL] = RC_PRTY[CONTROL_ROLL] + EC_PRTY[CONTROL_ROLL];
// This can be a CPU time killer if the function implementations are inefficient.
controlThrottle = HC_getThrottle(AC_getThrottle(RC_PRTY[CONTROL_THROTTLE]
controlThrottle = AC_getThrottle(HC_getThrottle(RC_PRTY[CONTROL_THROTTLE]
+ EC_PRTY[CONTROL_THROTTLE]));
controlYaw = RC_PRTY[CONTROL_YAW] + EC_PRTY[CONTROL_YAW];
 
/branches/dongfang_FC_rewrite/flight.c
1,4 → 1,4
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
\// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Copyright (c) 04.2007 Holger Buss
// + Nur f�r den privaten Gebrauch
// + www.MikroKopter.com
120,12 → 120,10
/************************************************************************/
void flight_setNeutral() {
MKFlags |= MKFLAG_CALIBRATE;
 
// not really used here any more.
dynamicParams.KalmanK = -1;
dynamicParams.KalmanMaxDrift = 0;
dynamicParams.KalmanMaxFusion = 32;
 
controlMixer_initVariables();
}
 
262,6 → 260,8
if(looping) {
if(throttleTerm > staticParams.LoopGasLimit) throttleTerm = staticParams.LoopGasLimit;
}
 
J5LOW;
/************************************************************************/
/* Yawing */
348,6 → 348,8
// Scale up to higher resolution. Hmm why is it not (from controlMixer and down) scaled already?
throttleTerm *= CONTROL_SCALING;
 
J5HIGH;
 
/*
* Compose yaw term.
* The yaw term is limited: Absolute value is max. = the throttle term / 2.
388,6 → 390,9
yawTerm = (tmp_int - throttleTerm);
DebugOut.Digital[0] |= DEBUG_CLIP;
}
 
J5LOW;
 
// CHECK_MIN_MAX(yawTerm, -(tmp_int - throttleTerm), (tmp_int - throttleTerm));
DebugOut.Digital[1] &= ~DEBUG_CLIP;
for (axis=PITCH; axis<=ROLL; axis++) {
427,6 → 432,8
}
// end part 3: 350 - 400 usec.
 
J5HIGH;
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Universal Mixer
// Each (pitch, roll, throttle, yaw) term is in the range [0..255 * CONTROL_SCALING].
468,6 → 475,8
}
I2C_Start(TWI_STATE_MOTOR_TX);
J5LOW;
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Debugging
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
487,5 → 496,4
DebugOut.Analog[31] = gyroNoisePeak[ROLL];
*/
}
J5LOW;
}
/branches/dongfang_FC_rewrite/heightControl.c
65,7 → 65,7
maxHeight = height;
 
if (staticParams.GlobalConfig & CFG_HEIGHT_SWITCH) {
// If switch is activated in config
// If switch is activated in config, the MaxHeight parameter is a switch value: ON in both ends of the range; OFF in the middle.
DebugOut.Digital[0] |= DEBUG_HEIGHT_SWITCH;
if (dynamicParams.MaxHeight < 40 || dynamicParams.MaxHeight > 255 - 40) {
// Switch is ON