Rev 1983 | Rev 2009 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1983 | Rev 2008 | ||
---|---|---|---|
Line 691... | Line 691... | ||
691 | MotorenEin = 0; |
691 | MotorenEin = 0; |
692 | modell_fliegt = 0; |
692 | modell_fliegt = 0; |
693 | FC_StatusFlags &= ~(FC_STATUS_EMERGENCY_LANDING | FC_STATUS_FLY); |
693 | FC_StatusFlags &= ~(FC_STATUS_EMERGENCY_LANDING | FC_STATUS_FLY); |
694 | } |
694 | } |
695 | ROT_ON; |
695 | ROT_ON; |
696 | if(modell_fliegt > 1000) // wahrscheinlich in der Luft --> langsam absenken |
696 | if(modell_fliegt > 1000 && Capacity.MinOfMaxPWM > 100) // wahrscheinlich in der Luft --> langsam absenken |
697 | { |
697 | { |
698 | GasMischanteil = EE_Parameter.NotGas; |
698 | GasMischanteil = EE_Parameter.NotGas; |
- | 699 | if(EE_Parameter.GlobalConfig3 & CFG3_VARIO_FAILSAFE) |
|
- | 700 | { |
|
- | 701 | if(HoverGas && HoverGas < 150 * STICK_GAIN) GasMischanteil = HoverGas/(STICK_GAIN + STICK_GAIN/4); // 80% of Hovergas |
|
- | 702 | } |
|
699 | FC_StatusFlags |= FC_STATUS_EMERGENCY_LANDING; |
703 | FC_StatusFlags |= FC_STATUS_EMERGENCY_LANDING; |
700 | PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
704 | PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
701 | PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
705 | PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
702 | PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
706 | PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
703 | PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
707 | PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
Line 1815... | Line 1819... | ||
1815 | // Gier |
1819 | // Gier |
1816 | if(Mixer.Motor[i][3] == 64) tmp_int += GierMischanteil; |
1820 | if(Mixer.Motor[i][3] == 64) tmp_int += GierMischanteil; |
1817 | else if(Mixer.Motor[i][3] == -64) tmp_int -= GierMischanteil; |
1821 | else if(Mixer.Motor[i][3] == -64) tmp_int -= GierMischanteil; |
1818 | else tmp_int += ((long)GierMischanteil * Mixer.Motor[i][3]) / 64L; |
1822 | else tmp_int += ((long)GierMischanteil * Mixer.Motor[i][3]) / 64L; |
Line -... | Line 1823... | ||
- | 1823 | ||
- | 1824 | //if(Parameter_UserParam7 < 128) |
|
1819 | 1825 | { |
|
1820 | if(tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2; // MotorSmoothing |
1826 | if(tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2; // MotorSmoothing |
1821 | // else tmp_int = 2 * tmp_int - tmp_motorwert[i]; // original MotorSmoothing |
1827 | // else tmp_int = 2 * tmp_int - tmp_motorwert[i]; // original MotorSmoothing |
1822 | else |
1828 | else |
1823 | { |
1829 | { |
Line 1830... | Line 1836... | ||
1830 | { |
1836 | { |
1831 | // If >= 2 then allow >= 50% of the intended step down to rapidly reach the intended value. |
1837 | // If >= 2 then allow >= 50% of the intended step down to rapidly reach the intended value. |
1832 | tmp_int = tmp_int + ((tmp_motorwert[i] - tmp_int)/EE_Parameter.MotorSmooth); |
1838 | tmp_int = tmp_int + ((tmp_motorwert[i] - tmp_int)/EE_Parameter.MotorSmooth); |
1833 | } |
1839 | } |
1834 | } |
1840 | } |
- | 1841 | } |
|
Line 1835... | Line 1842... | ||
1835 | 1842 | ||
1836 | LIMIT_MIN_MAX(tmp_int,(int) MIN_GAS * 4,(int) MAX_GAS * 4); |
1843 | LIMIT_MIN_MAX(tmp_int,(int) MIN_GAS * 4,(int) MAX_GAS * 4); |
1837 | Motor[i].SetPoint = tmp_int / 4; |
1844 | Motor[i].SetPoint = tmp_int / 4; |
1838 | Motor[i].SetPointLowerBits = (tmp_int % 4)<<1; // (3 bits total) |
1845 | Motor[i].SetPointLowerBits = (tmp_int % 4)<<1; // (3 bits total) |