Rev 927 | Rev 929 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 927 | Rev 928 | ||
---|---|---|---|
Line 705... | Line 705... | ||
705 | 705 | ||
706 | if(EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) IntegralFaktor = 0; |
706 | if(EE_Parameter.GlobalConfig & CFG_HEADING_HOLD) IntegralFaktor = 0; |
707 | if(GyroFaktor < 0) GyroFaktor = 0; |
707 | if(GyroFaktor < 0) GyroFaktor = 0; |
Line 708... | Line 708... | ||
708 | if(IntegralFaktor < 0) IntegralFaktor = 0; |
708 | if(IntegralFaktor < 0) IntegralFaktor = 0; |
- | 709 | ||
- | 710 | if(abs(StickNick/STICK_GAIN) > MaxStickNick) |
|
- | 711 | { |
|
- | 712 | MaxStickNick = abs(StickNick)/STICK_GAIN; |
|
- | 713 | if(MaxStickNick > 100) MaxStickNick = 100; |
|
709 | 714 | } |
|
- | 715 | else MaxStickNick--; |
|
- | 716 | if(abs(StickRoll/STICK_GAIN) > MaxStickRoll) |
|
- | 717 | { |
|
- | 718 | MaxStickRoll = abs(StickRoll)/STICK_GAIN; |
|
- | 719 | if(MaxStickRoll > 100) MaxStickRoll = 100; |
|
710 | if(abs(StickNick/STICK_GAIN) > MaxStickNick) MaxStickNick = abs(StickNick)/STICK_GAIN; else MaxStickNick--; |
720 | } |
Line 711... | Line 721... | ||
711 | if(abs(StickRoll/STICK_GAIN) > MaxStickRoll) MaxStickRoll = abs(StickRoll)/STICK_GAIN; else MaxStickRoll--; |
721 | else MaxStickRoll--; |
712 | if(Notlandung) {MaxStickNick = 0; MaxStickRoll = 0;} |
722 | if(Notlandung) {MaxStickNick = 0; MaxStickRoll = 0;} |
713 | 723 | ||
Line 803... | Line 813... | ||
803 | long tmp_long, tmp_long2; |
813 | long tmp_long, tmp_long2; |
804 | tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick); |
814 | tmp_long = (long)(IntegralNick / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccNick); |
805 | tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll); |
815 | tmp_long2 = (long)(IntegralRoll / EE_Parameter.GyroAccFaktor - (long)Mittelwert_AccRoll); |
806 | tmp_long /= 16; |
816 | tmp_long /= 16; |
807 | tmp_long2 /= 16; |
817 | tmp_long2 /= 16; |
808 | if((MaxStickNick > 32) || (MaxStickRoll > 32)) |
818 | if((MaxStickNick > 64) || (MaxStickRoll > 64)) |
809 | { |
819 | { |
810 | tmp_long /= 3; |
820 | tmp_long /= 3; |
811 | tmp_long2 /= 3; |
821 | tmp_long2 /= 3; |
812 | } |
822 | } |
813 | if(abs(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]) > 25) |
823 | if(abs(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]) > 25) |
Line 848... | Line 858... | ||
848 | ausgleichRoll = IntegralFehlerRoll / EE_Parameter.GyroAccAbgleich; |
858 | ausgleichRoll = IntegralFehlerRoll / EE_Parameter.GyroAccAbgleich; |
Line 849... | Line 859... | ||
849 | 859 | ||
850 | LageKorrekturNick = ausgleichNick / ABGLEICH_ANZAHL; |
860 | LageKorrekturNick = ausgleichNick / ABGLEICH_ANZAHL; |
Line 851... | Line 861... | ||
851 | LageKorrekturRoll = ausgleichRoll / ABGLEICH_ANZAHL; |
861 | LageKorrekturRoll = ausgleichRoll / ABGLEICH_ANZAHL; |
852 | 862 | ||
853 | if((MaxStickNick > 32) || (MaxStickRoll > 32) || (abs(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]) > 25)) |
863 | if((MaxStickNick > 64) || (MaxStickRoll > 64) || (abs(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]) > 25)) |
854 | { |
864 | { |
855 | LageKorrekturNick /= 2; |
865 | LageKorrekturNick /= 2; |