Rev 1253 | Rev 1266 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1253 | Rev 1254 | ||
---|---|---|---|
Line 77... | Line 77... | ||
77 | int KompassValue = 0; |
77 | int KompassValue = 0; |
78 | int KompassStartwert = 0; |
78 | int KompassStartwert = 0; |
79 | int KompassRichtung = 0; |
79 | int KompassRichtung = 0; |
80 | unsigned int KompassSignalSchlecht = 500; |
80 | unsigned int KompassSignalSchlecht = 500; |
81 | unsigned char MAX_GAS,MIN_GAS; |
81 | unsigned char MAX_GAS,MIN_GAS; |
82 | unsigned char Notlandung = 0; |
- | |
83 | unsigned char HoehenReglerAktiv = 0; |
82 | unsigned char HoehenReglerAktiv = 0; |
84 | unsigned char TrichterFlug = 0; |
83 | unsigned char TrichterFlug = 0; |
85 | long Umschlag180Nick = 250000L, Umschlag180Roll = 250000L; |
84 | long Umschlag180Nick = 250000L, Umschlag180Roll = 250000L; |
86 | long ErsatzKompass; |
85 | long ErsatzKompass; |
87 | int ErsatzKompassInGrad; // Kompasswert in Grad |
86 | int ErsatzKompassInGrad; // Kompasswert in Grad |
Line 571... | Line 570... | ||
571 | } |
570 | } |
572 | if(RcLostTimer) RcLostTimer--; |
571 | if(RcLostTimer) RcLostTimer--; |
573 | else |
572 | else |
574 | { |
573 | { |
575 | MotorenEin = 0; |
574 | MotorenEin = 0; |
576 | Notlandung = 0; |
575 | MikroKopterFlags &= ~FLAG_NOTLANDUNG; |
577 | } |
576 | } |
578 | ROT_ON; |
577 | ROT_ON; |
579 | if(modell_fliegt > 1000) // wahrscheinlich in der Luft --> langsam absenken |
578 | if(modell_fliegt > 1000) // wahrscheinlich in der Luft --> langsam absenken |
580 | { |
579 | { |
581 | GasMischanteil = EE_Parameter.NotGas; |
580 | GasMischanteil = EE_Parameter.NotGas; |
582 | Notlandung = 1; |
581 | MikroKopterFlags |= FLAG_NOTLANDUNG; |
583 | PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
582 | PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
584 | PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
583 | PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
585 | PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
584 | PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
586 | PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
585 | PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
587 | PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] = 0; |
586 | PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] = 0; |
Line 592... | Line 591... | ||
592 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
591 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
593 | // Emfang gut |
592 | // Emfang gut |
594 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
593 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
595 | if(SenderOkay > 140) |
594 | if(SenderOkay > 140) |
596 | { |
595 | { |
597 | Notlandung = 0; |
596 | MikroKopterFlags &= ~FLAG_NOTLANDUNG; |
598 | RcLostTimer = EE_Parameter.NotGasZeit * 50; |
597 | RcLostTimer = EE_Parameter.NotGasZeit * 50; |
599 | if(GasMischanteil > 40 && MotorenEin) |
598 | if(GasMischanteil > 40 && MotorenEin) |
600 | { |
599 | { |
601 | if(modell_fliegt < 0xffff) modell_fliegt++; |
600 | if(modell_fliegt < 0xffff) modell_fliegt++; |
602 | } |
601 | } |
Line 726... | Line 725... | ||
726 | 725 | ||
727 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
726 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
728 | // neue Werte von der Funke |
727 | // neue Werte von der Funke |
Line 729... | Line 728... | ||
729 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
728 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
730 | 729 | ||
731 | if(!NewPpmData-- || Notlandung) |
730 | if(!NewPpmData-- || (MikroKopterFlags & FLAG_NOTLANDUNG)) |
732 | { |
731 | { |
733 | static int stick_nick,stick_roll; |
732 | static int stick_nick,stick_roll; |
734 | ParameterZuordnung(); |
733 | ParameterZuordnung(); |
Line 777... | Line 776... | ||
777 | { |
776 | { |
778 | MaxStickRoll = abs(StickRoll)/STICK_GAIN; |
777 | MaxStickRoll = abs(StickRoll)/STICK_GAIN; |
779 | if(MaxStickRoll > 100) MaxStickRoll = 100; |
778 | if(MaxStickRoll > 100) MaxStickRoll = 100; |
780 | } |
779 | } |
781 | else MaxStickRoll--; |
780 | else MaxStickRoll--; |
782 | if(Notlandung) {MaxStickNick = 0; MaxStickRoll = 0;} |
781 | if(MikroKopterFlags & FLAG_NOTLANDUNG) {MaxStickNick = 0; MaxStickRoll = 0;} |
Line 783... | Line 782... | ||
783 | 782 | ||
784 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
783 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
785 | // Looping? |
784 | // Looping? |
786 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
785 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
Line 829... | Line 828... | ||
829 | 828 | ||
830 | 829 | ||
831 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
830 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
832 | // Bei Empfangsausfall im Flug |
831 | // Bei Empfangsausfall im Flug |
833 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
832 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
834 | if(Notlandung) |
833 | if(MikroKopterFlags & FLAG_NOTLANDUNG) |
835 | { |
834 | { |
836 | StickGier = 0; |
835 | StickGier = 0; |
837 | StickNick = 0; |
836 | StickNick = 0; |
Line 1309... | Line 1308... | ||
1309 | { |
1308 | { |
1310 | SollHoehe = ((int) ExternHoehenValue + (int) Parameter_MaxHoehe) * (int)EE_Parameter.Hoehe_Verstaerkung - 20; |
1309 | SollHoehe = ((int) ExternHoehenValue + (int) Parameter_MaxHoehe) * (int)EE_Parameter.Hoehe_Verstaerkung - 20; |
1311 | HoehenReglerAktiv = 1; |
1310 | HoehenReglerAktiv = 1; |
1312 | } |
1311 | } |
Line 1313... | Line 1312... | ||
1313 | 1312 | ||
1314 | if(Notlandung) SollHoehe = 0; |
1313 | if(MikroKopterFlags & FLAG_NOTLANDUNG) SollHoehe = 0; |
1315 | h = HoehenWert; |
1314 | h = HoehenWert; |
1316 | if((h > SollHoehe) && HoehenReglerAktiv) // zu hoch --> drosseln |
1315 | if((h > SollHoehe) && HoehenReglerAktiv) // zu hoch --> drosseln |
1317 | { |
1316 | { |
1318 | h = ((h - SollHoehe) * (int) Parameter_Hoehe_P) / 16; // Differenz bestimmen --> P-Anteil |
1317 | h = ((h - SollHoehe) * (int) Parameter_Hoehe_P) / 16; // Differenz bestimmen --> P-Anteil |