Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 1313 → Rev 1314

/trunk/fc.c
1173,7 → 1173,7
DebugOut.Analog[2] = Mittelwert_AccNick / 4;
DebugOut.Analog[3] = Mittelwert_AccRoll / 4;
DebugOut.Analog[4] = MesswertGier;
DebugOut.Analog[5] = HoehenWert/5;
DebugOut.Analog[5] = HoehenWert/5;
DebugOut.Analog[6] = Aktuell_az;//(Mess_Integral_Hoch / 512);//Aktuell_az;
DebugOut.Analog[8] = KompassValue;
DebugOut.Analog[9] = UBat;
1338,12 → 1338,12
// the height control is only an attenuation of the actual gas stick.
// I.e. it will work only if the gas stick is higher than the hover gas
// and the hover height will be allways larger than height setpoint.
if((EE_Parameter.ExtraConfig & CFG2_HEIGHT_LIMIT) || !(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER)) // Regler wird über Schalter gesteuert)
{ // old version
if((EE_Parameter.ExtraConfig & CFG2_HEIGHT_LIMIT) || !(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER)) // Regler wird über Schalter gesteuert)
{ // old version
HCGas = GasMischanteil; // take current stick gas as neutral point for the height control
HeightTrimming = 0;
}
else
else
{
// alternative height control
// PD-Control with respect to hoover point
1392,8 → 1392,8
else SollHoehe = HoehenWert - 200;
HCGas = HooverGas; // take hoover gas (neutral point)
}
if(HoehenWert > SollHoehe || !(EE_Parameter.ExtraConfig & CFG2_HEIGHT_LIMIT))
 
if(HoehenWert > SollHoehe || !(EE_Parameter.ExtraConfig & CFG2_HEIGHT_LIMIT))
{
// ------------------------- P-Part ----------------------------
HeightDeviation = (int)(HoehenWert - SollHoehe); // positive when too high
1414,7 → 1414,7
HCGas -= tmp_int;
 
// limit deviation from hoover point within the target region
if( (!HeightTrimming) && (HooverGas > 0)) // height setpoint is not changed and hoover gas not zero
if( (abs(HeightDeviation) < 150) && (!HeightTrimming) && (HooverGas > 0)) // height setpoint is not changed and hoover gas not zero
{
LIMIT_MIN_MAX(HCGas, HooverGasMin, HooverGasMax); // limit gas around the hoover point
}
1435,12 → 1435,12
// limit height control gas pd-control output
LIMIT_MIN_MAX(FilterHCGas, EE_Parameter.Hoehe_MinGas * STICK_GAIN, (MAX_GAS - 20) * STICK_GAIN);
// set GasMischanteil to HeightControlGasFilter
if(EE_Parameter.ExtraConfig & CFG2_HEIGHT_LIMIT)
{ // old version
if(EE_Parameter.ExtraConfig & CFG2_HEIGHT_LIMIT)
{ // old version
if(FilterHCGas > GasMischanteil) FilterHCGas = GasMischanteil; // nicht mehr als Gas
}
}
GasMischanteil = FilterHCGas;
}
}
}// EOF height control active
 
// Hoover gas estimation by averaging gas control output on small z-velocities