Subversion Repositories FlightCtrl

Rev

Rev 2380 | Rev 2382 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2380 Rev 2381
Line 1722... Line 1722...
1722
                // the setpoint will be fine adjusted with the gas stick position
1722
                // the setpoint will be fine adjusted with the gas stick position
1723
                        if(FC_StatusFlags & FC_STATUS_FLY) // trim setpoint only when flying
1723
                        if(FC_StatusFlags & FC_STATUS_FLY) // trim setpoint only when flying
1724
                        {   // gas stick is above hoover point
1724
                        {   // gas stick is above hoover point
1725
                                if(StickGas > (StickGasHover + HEIGHT_CONTROL_STICKTHRESHOLD) && !BaroAtUpperLimit)
1725
                                if(StickGas > (StickGasHover + HEIGHT_CONTROL_STICKTHRESHOLD) && !BaroAtUpperLimit)
1726
                                {
1726
                                {
1727
if(HeightDeviation > 20) SollHoehe = HoehenWertF; // update setpoint to current heigth 
-
 
1728
                                        if(FC_StatusFlags & FC_STATUS_VARIO_TRIM_DOWN)
1727
                                        if(FC_StatusFlags & FC_STATUS_VARIO_TRIM_DOWN)
1729
                                        {
1728
                                        {
1730
                                                FC_StatusFlags &= ~FC_STATUS_VARIO_TRIM_DOWN;
1729
                                                FC_StatusFlags &= ~FC_STATUS_VARIO_TRIM_DOWN;
1731
                                                SollHoehe = HoehenWertF; // update setpoint to current heigth
1730
                                                SollHoehe = HoehenWertF; // update setpoint to current heigth
1732
                                        }
1731
                                        }
1733
                                        FC_StatusFlags |= FC_STATUS_VARIO_TRIM_UP;
-
 
1734
                                        // Limit the maximum Altitude
1732
                                        // Limit the maximum Altitude
1735
                                        if(Parameter_MaximumAltitude && (SollHoehe/100 > Parameter_MaximumAltitude)) AltitudeSetpointTrimming = 0;
1733
                                        if(Parameter_MaximumAltitude && (SollHoehe/100 > Parameter_MaximumAltitude))
-
 
1734
                                         {
-
 
1735
                                          AltitudeSetpointTrimming = 0;
-
 
1736
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
-
 
1737
                                          if(!SpeakHoTT && HoehenWert/95 > Parameter_MaximumAltitude) SpeakHoTT = SPEAK_MAX_ALTITUD;
-
 
1738
#endif
-
 
1739
                                          VarioCharacter = '=';
-
 
1740
                                         }
1736
                                        else
1741
                                        else
1737
                                        {
1742
                                        {
1738
//                                      SollHoehe = (long) Parameter_MaximumAltitude * 100L;
1743
//                                      SollHoehe = (long) Parameter_MaximumAltitude * 100L;
1739
//                                      HeightTrimming += abs(StickGas - (StickGasHover - HEIGHT_CONTROL_STICKTHRESHOLD));
1744
//                                      HeightTrimming += abs(StickGas - (StickGasHover - HEIGHT_CONTROL_STICKTHRESHOLD));
-
 
1745
                                        if(HeightDeviation > 20) SollHoehe = HoehenWertF; // update setpoint to current heigth 
-
 
1746
                                        FC_StatusFlags |= FC_STATUS_VARIO_TRIM_UP;
1740
                                        AltitudeSetpointTrimming = abs(StickGas - (StickGasHover + HEIGHT_CONTROL_STICKTHRESHOLD));
1747
                                        AltitudeSetpointTrimming = abs(StickGas - (StickGasHover + HEIGHT_CONTROL_STICKTHRESHOLD));
1741
                                        VarioCharacter = '+';
1748
                                        VarioCharacter = '+';
1742
                                        }
1749
                                        }
1743
                                        WaypointTrimming = 0;
1750
                                        WaypointTrimming = 0;
1744
                                } // gas stick is below hoover point
1751
                                } // gas stick is below hoover point