Subversion Repositories FlightCtrl

Rev

Rev 2382 | Rev 2389 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2382 Rev 2386
Line 2156... Line 2156...
2156
            // Gier
2156
            // Gier
2157
                        if(Mixer.Motor[i][3] == 64) tmp_int += GierMischanteil;
2157
                        if(Mixer.Motor[i][3] == 64) tmp_int += GierMischanteil;
2158
                        else if(Mixer.Motor[i][3] == -64) tmp_int -= GierMischanteil;
2158
                        else if(Mixer.Motor[i][3] == -64) tmp_int -= GierMischanteil;
2159
                        else tmp_int += ((long)GierMischanteil * Mixer.Motor[i][3]) / 64L;
2159
                        else tmp_int += ((long)GierMischanteil * Mixer.Motor[i][3]) / 64L;
Line 2160... Line 2160...
2160
 
2160
 
2161
                        if(tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2;      // MotorSmoothing
2161
                        if(Motor[i].Version & MOTOR_STATE_FAST_MODE || tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2;      // Beschleunigen
2162
            else
2162
            else
2163
                        {
-
 
2164
                                                        unsigned char smooth;
-
 
2165
                                                        smooth = EE_Parameter.MotorSmooth;
-
 
2166
                                                        if(!smooth && Motor[i].Version & MOTOR_STATE_FAST_MODE) smooth = 2;
2163
                         {
2167
                            if(smooth == 0)
2164
                            if(EE_Parameter.MotorSmooth == 0)
2168
                                {
2165
                                {
2169
                                  tmp_int = 2 * tmp_int - tmp_motorwert[i];  // original MotorSmoothing
2166
                                  tmp_int = 2 * tmp_int - tmp_motorwert[i];  // original MotorSmoothing
2170
                                }
2167
                                }
2171
                                                        else  // 1 means tmp_int = tmp_int;
2168
                                                        else  // 1 means tmp_int = tmp_int;
2172
                            if(smooth > 1)
2169
                            if(EE_Parameter.MotorSmooth > 1)
2173
                                {
2170
                                {
2174
                                        // If >= 2 then allow >= 50% of the intended step down to rapidly reach the intended value.
2171
                                  // If >= 2 then allow >= 50% of the intended step down to rapidly reach the intended value.
2175
                                  tmp_int = tmp_int + ((tmp_motorwert[i] - tmp_int) / smooth);
2172
                                  tmp_int = tmp_int + ((tmp_motorwert[i] - tmp_int) / EE_Parameter.MotorSmooth);
2176
                                }
2173
                                }
2177
                        }
2174
                        }
2178
                        LIMIT_MIN_MAX(tmp_int,(int) MIN_GAS * 4,(int) MAX_GAS * 4);
2175
                        LIMIT_MIN_MAX(tmp_int,(int) MIN_GAS * 4,(int) MAX_GAS * 4);
2179
                        Motor[i].SetPoint = tmp_int / 4;
2176
                        Motor[i].SetPoint = tmp_int / 4;