Rev 1929 | Rev 1932 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1929 | Rev 1931 | ||
---|---|---|---|
Line 1702... | Line 1702... | ||
1702 | if(GasMischanteil > (MAX_GAS - 20) * STICK_GAIN) GasMischanteil = (MAX_GAS - 20) * STICK_GAIN; |
1702 | if(GasMischanteil > (MAX_GAS - 20) * STICK_GAIN) GasMischanteil = (MAX_GAS - 20) * STICK_GAIN; |
Line 1703... | Line 1703... | ||
1703 | 1703 | ||
1704 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1704 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1705 | // all BL-Ctrl connected? |
1705 | // all BL-Ctrl connected? |
1706 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1706 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1707 | if(MissingMotor || Capacity.MinOfMaxPWM != 255) |
1707 | if(MissingMotor || Capacity.MinOfMaxPWM != 255) // wait until all BL-Ctrls started |
1708 | if(modell_fliegt > 1 && modell_fliegt < 50 && GasMischanteil > 0) |
1708 | if(modell_fliegt > 1 && modell_fliegt < 50 && GasMischanteil > 0) // only during start-phase |
1709 | { |
1709 | { |
1710 | modell_fliegt = 1; |
1710 | modell_fliegt = 1; |
1711 | GasMischanteil = (MIN_GAS + 10) * STICK_GAIN; |
1711 | GasMischanteil = (MIN_GAS + 10) * STICK_GAIN; |
1712 | } |
1712 | } |
Line 1789... | Line 1789... | ||
1789 | if(Mixer.Motor[i][3] == 64) tmp_int += GierMischanteil; |
1789 | if(Mixer.Motor[i][3] == 64) tmp_int += GierMischanteil; |
1790 | else if(Mixer.Motor[i][3] == -64) tmp_int -= GierMischanteil; |
1790 | else if(Mixer.Motor[i][3] == -64) tmp_int -= GierMischanteil; |
1791 | else tmp_int += ((long)GierMischanteil * Mixer.Motor[i][3]) / 64L; |
1791 | else tmp_int += ((long)GierMischanteil * Mixer.Motor[i][3]) / 64L; |
Line 1792... | Line 1792... | ||
1792 | 1792 | ||
1793 | if(tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2; // MotorSmoothing |
- | |
1794 | else tmp_int = 2 * tmp_int - tmp_motorwert[i]; // MotorSmoothing |
- | |
1795 | - | ||
1796 | if(tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2; // MotorSmoothing |
1793 | if(tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2; // MotorSmoothing |
1797 | // else tmp_int = 2 * tmp_int - tmp_motorwert[i]; // original MotorSmoothing |
1794 | // else tmp_int = 2 * tmp_int - tmp_motorwert[i]; // original MotorSmoothing |
1798 | else |
1795 | else |
1799 | { |
1796 | { |
1800 | if(EE_Parameter.MotorSmooth == 0) |
1797 | if(EE_Parameter.MotorSmooth == 0) |
1801 | { |
1798 | { |
1802 | tmp_int = 2 * tmp_int - tmp_motorwert[i]; |
1799 | tmp_int = 2 * tmp_int - tmp_motorwert[i]; // original MotorSmoothing |
1803 | } |
1800 | } |
1804 | else // 1 means tmp_int = tmp_int; |
1801 | else // 1 means tmp_int = tmp_int; |
1805 | if(EE_Parameter.MotorSmooth > 1) |
1802 | if(EE_Parameter.MotorSmooth > 1) |
1806 | { |
1803 | { |
1807 | // If >= 2 then allow >= 50% of the intended step down to rapidly reach the intended value. |
1804 | // If >= 2 then allow >= 50% of the intended step down to rapidly reach the intended value. |
1808 | tmp_int = tmp_int + ((tmp_motorwert[i] - tmp_int)/EE_Parameter.MotorSmooth); |
1805 | tmp_int = tmp_int + ((tmp_motorwert[i] - tmp_int)/EE_Parameter.MotorSmooth); |
1809 | } |
1806 | } |
- | 1807 | } |
|
1810 | } |
1808 | |
1811 | LIMIT_MIN_MAX(tmp_int,(int) MIN_GAS * 4,(int) MAX_GAS * 4); |
1809 | LIMIT_MIN_MAX(tmp_int,(int) MIN_GAS * 4,(int) MAX_GAS * 4); |
1812 | Motor[i].SetPoint = tmp_int / 4; |
1810 | Motor[i].SetPoint = tmp_int / 4; |
1813 | Motor[i].SetPointLowerBits = (tmp_int % 4)<<1; // (3 bits total) |
1811 | Motor[i].SetPointLowerBits = (tmp_int % 4)<<1; // (3 bits total) |
1814 | tmp_motorwert[i] = tmp_int; |
1812 | tmp_motorwert[i] = tmp_int; |