Subversion Repositories FlightCtrl

Rev

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

Rev 2416 Rev 2418
Line 608... Line 608...
608
                  }
608
                  }
609
          if(PC_MotortestActive) PC_MotortestActive--;
609
          if(PC_MotortestActive) PC_MotortestActive--;
610
        }
610
        }
611
        else FC_StatusFlags |= FC_STATUS_MOTOR_RUN;
611
        else FC_StatusFlags |= FC_STATUS_MOTOR_RUN;
Line -... Line 612...
-
 
612
 
-
 
613
// ++++++++++++++++++++++++++++++++++++++++++
-
 
614
 
-
 
615
// ++++++++++++++++++++++++++++++++++++++++++
-
 
616
#ifdef REDUNDANT_FC
-
 
617
        I2CTimeout = 100;
-
 
618
        return;
-
 
619
#else 
-
 
620
/*
-
 
621
if(Parameter_UserParam7 < 100 && RedundanceBlOperation)
-
 
622
 {
-
 
623
        I2CTimeout = 100;
-
 
624
   if((BeepMuster == 0xffff))
-
 
625
                   {
-
 
626
                    beeptime = 25000;
-
 
627
                    BeepMuster = 0x0080;
-
 
628
                   }
-
 
629
        return;
-
 
630
 }
-
 
631
*/
-
 
632
#endif
612
 
633
 
613
    if(I2C_TransferActive)
634
    if(I2C_TransferActive)
614
         {
635
         {
615
          I2C_TransferActive = 0; // enable for the next time
636
          I2C_TransferActive = 0; // enable for the next time
616
         }
637
         }
Line 2107... Line 2128...
2107
  if(GasMischanteil > (MAX_GAS - 20) * STICK_GAIN) GasMischanteil = (MAX_GAS - 20) * STICK_GAIN;
2128
  if(GasMischanteil > (MAX_GAS - 20) * STICK_GAIN) GasMischanteil = (MAX_GAS - 20) * STICK_GAIN;
Line 2108... Line 2129...
2108
 
2129
 
2109
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2130
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2110
// all BL-Ctrl connected?
2131
// all BL-Ctrl connected?
2111
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2132
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2112
  if(MissingMotor || Capacity.MinOfMaxPWM != 255 || NC_ErrorCode)      // wait until all BL-Ctrls started and no Errors
2133
  if(MissingMotor || Capacity.MinOfMaxPWM < 254 || NC_ErrorCode)      // wait until all BL-Ctrls started and no Errors
2113
  if(modell_fliegt > 1 && modell_fliegt < 50 && GasMischanteil > 0)    // only during start-phase
2134
  if(modell_fliegt > 1 && modell_fliegt < 50 && GasMischanteil > 0)    // only during start-phase
2114
   {
2135
   {
2115
    modell_fliegt = 1;
2136
    modell_fliegt = 1;
2116
        GasMischanteil = (MIN_GAS + 10) * STICK_GAIN;
2137
        GasMischanteil = (MIN_GAS + 10) * STICK_GAIN;
Line 2199... Line 2220...
2199
                        else tmp_int += ((long)pd_ergebnis_roll * Mixer.Motor[i][2]) / 64L;
2220
                        else tmp_int += ((long)pd_ergebnis_roll * Mixer.Motor[i][2]) / 64L;
2200
            // Gier
2221
            // Gier
2201
                        if(Mixer.Motor[i][3] == 64) tmp_int += GierMischanteil;
2222
                        if(Mixer.Motor[i][3] == 64) tmp_int += GierMischanteil;
2202
                        else if(Mixer.Motor[i][3] == -64) tmp_int -= GierMischanteil;
2223
                        else if(Mixer.Motor[i][3] == -64) tmp_int -= GierMischanteil;
2203
                        else tmp_int += ((long)GierMischanteil * Mixer.Motor[i][3]) / 64L;
2224
                        else tmp_int += ((long)GierMischanteil * Mixer.Motor[i][3]) / 64L;
-
 
2225
#ifdef REDUNDANT_FC
-
 
2226
                        tmp_int = (tmp_motorwert[i] + tmp_int) / 2;    
2204
 
2227
#else
2205
                        if(Motor[i].Version & MOTOR_STATE_FAST_MODE || tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2;      // Beschleunigen
2228
                        if(Motor[i].Version & MOTOR_STATE_FAST_MODE || tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2;      // Beschleunigen
2206
            else
2229
            else
2207
                         {  // BL-Ctrl 1.0 or 2.0 
2230
                         {  // BL-Ctrl 1.0 or 2.0 
2208
                            if(EE_Parameter.MotorSmooth == 0)
2231
                            if(EE_Parameter.MotorSmooth == 0)
2209
                                {
2232
                                {
Line 2214... Line 2237...
2214
                                {
2237
                                {
2215
                                  // If >= 2 then allow >= 50% of the intended step down to rapidly reach the intended value.
2238
                                  // If >= 2 then allow >= 50% of the intended step down to rapidly reach the intended value.
2216
                                  tmp_int = tmp_int + ((tmp_motorwert[i] - tmp_int) / EE_Parameter.MotorSmooth);
2239
                                  tmp_int = tmp_int + ((tmp_motorwert[i] - tmp_int) / EE_Parameter.MotorSmooth);
2217
                                }
2240
                                }
2218
                        }
2241
                        }
-
 
2242
#endif
2219
                        LIMIT_MIN_MAX(tmp_int,(int) MIN_GAS * 4,(int) MAX_GAS * 4);
2243
                        LIMIT_MIN_MAX(tmp_int,(int) MIN_GAS * 4,(int) MAX_GAS * 4);
2220
                        Motor[i].SetPoint = tmp_int / 4;
2244
                        Motor[i].SetPoint = tmp_int / 4;
2221
                        Motor[i].SetPointLowerBits = (tmp_int % 4)<<1; // (3 bits total)
2245
                        Motor[i].SetPointLowerBits = (tmp_int % 4)<<1; // (3 bits total)
2222
            tmp_motorwert[i] = tmp_int;
2246
            tmp_motorwert[i] = tmp_int;
2223
                }
2247
                }
Line 2225... Line 2249...
2225
                {
2249
                {
2226
                        Motor[i].SetPoint = 0;
2250
                        Motor[i].SetPoint = 0;
2227
                        Motor[i].SetPointLowerBits = 0;
2251
                        Motor[i].SetPointLowerBits = 0;
2228
                }
2252
                }
2229
        }
2253
        }
-
 
2254
//if(Parameter_UserParam6 > 200) Motor[0].SetPoint = 0;
2230
}
2255
}
2231
//DebugOut.Analog[16]
2256
//DebugOut.Analog[16]