Rev 2320 | Rev 2330 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2320 | Rev 2322 | ||
---|---|---|---|
Line 202... | Line 202... | ||
202 | DebugOut.Analog[12] = Motor[0].SetPoint; |
202 | DebugOut.Analog[12] = Motor[0].SetPoint; |
203 | DebugOut.Analog[13] = Motor[1].SetPoint; |
203 | DebugOut.Analog[13] = Motor[1].SetPoint; |
204 | DebugOut.Analog[14] = Motor[2].SetPoint; |
204 | DebugOut.Analog[14] = Motor[2].SetPoint; |
205 | DebugOut.Analog[15] = Motor[3].SetPoint; |
205 | DebugOut.Analog[15] = Motor[3].SetPoint; |
206 | DebugOut.Analog[20] = ServoNickValue; |
206 | DebugOut.Analog[20] = ServoNickValue; |
- | 207 | DebugOut.Analog[21] = HoverGas; |
|
207 | DebugOut.Analog[22] = Capacity.ActualCurrent; |
208 | DebugOut.Analog[22] = Capacity.ActualCurrent; |
208 | DebugOut.Analog[23] = Capacity.UsedCapacity; |
209 | DebugOut.Analog[23] = Capacity.UsedCapacity; |
209 | DebugOut.Analog[24] = SollHoehe/10; |
210 | DebugOut.Analog[24] = SollHoehe/10; |
210 | DebugOut.Analog[27] = KompassSollWert; |
211 | DebugOut.Analog[27] = KompassSollWert; |
211 | DebugOut.Analog[29] = Capacity.MinOfMaxPWM; |
212 | DebugOut.Analog[29] = Capacity.MinOfMaxPWM; |
Line 782... | Line 783... | ||
782 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
783 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
783 | // Emfang gut |
784 | // Emfang gut |
784 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
785 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
785 | if(SenderOkay > 140) |
786 | if(SenderOkay > 140) |
786 | { |
787 | { |
- | 788 | static unsigned int trigger = 0; |
|
787 | FC_StatusFlags &= ~FC_STATUS_EMERGENCY_LANDING; |
789 | FC_StatusFlags &= ~FC_STATUS_EMERGENCY_LANDING; |
788 | RcLostTimer = EE_Parameter.NotGasZeit * 50; |
790 | RcLostTimer = EE_Parameter.NotGasZeit * 50; |
789 | if(GasMischanteil > 40 && MotorenEin) |
791 | if(GasMischanteil > 40 && MotorenEin) |
790 | { |
792 | { |
791 | if(modell_fliegt < 0xffff) modell_fliegt++; |
793 | if(modell_fliegt < 0xffff) modell_fliegt++; |
Line 801... | Line 803... | ||
801 | else |
803 | else |
802 | { |
804 | { |
803 | FC_StatusFlags |= FC_STATUS_FLY; |
805 | FC_StatusFlags |= FC_STATUS_FLY; |
804 | if(FC_StatusFlags2 & FC_STATUS2_WAIT_FOR_TAKEOFF) |
806 | if(FC_StatusFlags2 & FC_STATUS2_WAIT_FOR_TAKEOFF) |
805 | { |
807 | { |
- | 808 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
|
- | 809 | if((NC_To_FC_Flags & NC_TO_FC_AUTOSTART) && (VarioCharacter == '=') && ACC_AltitudeControl) |
|
- | 810 | { |
|
- | 811 | FromNC_AltitudeSpeed = 100; |
|
- | 812 | FromNC_AltitudeSetpoint = 800; |
|
- | 813 | SollHoehe = 800; |
|
- | 814 | trigger = 1000; |
|
- | 815 | SpeakHoTT = SPEAK_NEXT_WP; |
|
- | 816 | /* if(StartTrigger != 2) |
|
- | 817 | { |
|
- | 818 | StartTrigger = 1; |
|
- | 819 | if(HoverGas < STICK_GAIN * 35) HoverGas = STICK_GAIN * 35; |
|
- | 820 | } |
|
- | 821 | */ |
|
- | 822 | } |
|
- | 823 | #endif |
|
806 | if(HoehenWert > 150 || HoehenWert < -350 || !(Parameter_GlobalConfig & CFG_HOEHENREGELUNG)) |
824 | if(HoehenWert > 150 || HoehenWert < -350 || !(Parameter_GlobalConfig & CFG_HOEHENREGELUNG)) |
807 | { |
825 | { |
808 | FC_StatusFlags2 &= ~FC_STATUS2_WAIT_FOR_TAKEOFF; |
826 | FC_StatusFlags2 &= ~FC_STATUS2_WAIT_FOR_TAKEOFF; |
809 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
827 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
810 | SpeakHoTT = SPEAK_RISING; |
828 | SpeakHoTT = SPEAK_RISING; |
- | 829 | trigger = 1000; |
|
811 | #endif |
830 | #endif |
812 | } |
831 | } |
813 | SummeNick = 0; |
832 | SummeNick = 0; |
814 | SummeRoll = 0; |
833 | SummeRoll = 0; |
815 | Mess_Integral_Gier = 0; |
834 | Mess_Integral_Gier = 0; |
816 | // sollGier = 0; |
835 | // sollGier = 0; |
817 | if(modell_fliegt > 1000) modell_fliegt = 1000; // for the Hooverpoint-Estimation |
836 | if(modell_fliegt > 1000) modell_fliegt = 1000; // for the Hooverpoint-Estimation |
818 | } |
837 | } |
- | 838 | else // Flying mode |
|
- | 839 | { |
|
- | 840 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
|
- | 841 | if(trigger < 1000) |
|
- | 842 | { |
|
- | 843 | trigger++; |
|
- | 844 | SummeNick = 0; |
|
- | 845 | SummeRoll = 0; |
|
- | 846 | Mess_Integral_Gier = 0; |
|
- | 847 | SollHoehe = HoehenWertF - 300; |
|
- | 848 | } |
|
- | 849 | else |
|
- | 850 | if(ACC_AltitudeControl && (VarioCharacter == 'v' || VarioCharacter == '-') && HoehenWert < 1000 /*&& FromNC_AltitudeSetpoint < 0*/) |
|
- | 851 | { |
|
- | 852 | if(Aktuell_az > 940) { trigger = 0; SpeakHoTT = SPEAK_LANDING; }; |
|
819 | } |
853 | } |
- | 854 | #endif |
|
- | 855 | } |
|
- | 856 | } // end of: modell_fliegt > 256 |
|
820 | if((PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] > 80) && MotorenEin == 0) |
857 | if((PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] > 80) && MotorenEin == 0) |
821 | { |
858 | { |
822 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
859 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
823 | // auf Nullwerte kalibrieren |
860 | // auf Nullwerte kalibrieren |
824 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
861 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
Line 1475... | Line 1512... | ||
1475 | static int HeightTrimming = 0; // rate for change of height setpoint |
1512 | static int HeightTrimming = 0; // rate for change of height setpoint |
1476 | static int HeightDeviation = 0, FilterHCGas = 0; |
1513 | static int HeightDeviation = 0, FilterHCGas = 0; |
1477 | static unsigned long HoverGasFilter = 0; |
1514 | static unsigned long HoverGasFilter = 0; |
1478 | static unsigned char delay = 100, BaroAtUpperLimit = 0, BaroAtLowerLimit = 0; |
1515 | static unsigned char delay = 100, BaroAtUpperLimit = 0, BaroAtLowerLimit = 0; |
Line 1479... | Line -... | ||
1479 | - | ||
1480 | // get the current hooverpoint |
- | |
Line 1481... | Line 1516... | ||
1481 | DebugOut.Analog[21] = HoverGas; |
1516 | |
1482 | 1517 | ||
1483 | // Expand the measurement |
1518 | // Expand the measurement |
1484 | // measurement of air pressure close to upper limit and no overflow in correction of the new OCR0A value occurs |
1519 | // measurement of air pressure close to upper limit and no overflow in correction of the new OCR0A value occurs |