Subversion Repositories FlightCtrl

Rev

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

Rev 104 Rev 106
Line 73... Line 73...
73
volatile int  KompassStartwert = 0;
73
volatile int  KompassStartwert = 0;
74
volatile int  KompassRichtung = 0;
74
volatile int  KompassRichtung = 0;
75
unsigned char MAX_GAS,MIN_GAS;
75
unsigned char MAX_GAS,MIN_GAS;
76
unsigned char Notlandung = 0;
76
unsigned char Notlandung = 0;
77
unsigned char HoehenReglerAktiv = 0;
77
unsigned char HoehenReglerAktiv = 0;
-
 
78
static int SignalSchlecht = 0;
78
 
79
 
79
float GyroFaktor;
80
float GyroFaktor;
80
float IntegralFaktor;
81
float IntegralFaktor;
Line 81... Line 82...
81
 
82
 
82
volatile int  DiffNick,DiffRoll;
83
volatile int  DiffNick,DiffRoll;
Line 593... Line 594...
593
        ZaehlMessungen = 0;
594
        ZaehlMessungen = 0;
594
        if(IntegralFehlerNick > 500/DRIFT_FAKTOR)   AdNeutralNick++;
595
        if(IntegralFehlerNick > 500/DRIFT_FAKTOR)   AdNeutralNick++;
595
        if(IntegralFehlerNick < -500/DRIFT_FAKTOR)  AdNeutralNick--;
596
        if(IntegralFehlerNick < -500/DRIFT_FAKTOR)  AdNeutralNick--;
596
        if(IntegralFehlerRoll > 500/DRIFT_FAKTOR)   AdNeutralRoll++;
597
        if(IntegralFehlerRoll > 500/DRIFT_FAKTOR)   AdNeutralRoll++;
597
        if(IntegralFehlerRoll < -500/DRIFT_FAKTOR)  AdNeutralRoll--;
598
        if(IntegralFehlerRoll < -500/DRIFT_FAKTOR)  AdNeutralRoll--;
-
 
599
//Salvo 31.8.2007 Abgleich Giergyro nur wenn Kompass aktiv und ok ist ***********************
-
 
600
                if (CFG_KOMPASS_FIX && (!SignalSchlecht))
-
 
601
                {
598
        if(Mess_Integral_Gier2 > 500/DRIFT_FAKTOR)  AdNeutralGier--;        
602
         if(Mess_Integral_Gier2 > 500/DRIFT_FAKTOR)  AdNeutralGier--;        
599
        if(Mess_Integral_Gier2 <-500/DRIFT_FAKTOR)  AdNeutralGier++;        
603
         if(Mess_Integral_Gier2 <-500/DRIFT_FAKTOR)  AdNeutralGier++;  
-
 
604
                }  
-
 
605
                else
-
 
606
                {
-
 
607
                  Mess_Integral_Gier2 = 0;     
-
 
608
                }
-
 
609
                   
-
 
610
// Salvo End ***********************
600
    ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern
611
    ANALOG_OFF; // ADC ausschalten, damit die Werte sich nicht während der Berechnung ändern
601
        Mess_IntegralNick2 = IntegralNick;
612
        Mess_IntegralNick2 = IntegralNick;
602
        Mess_IntegralRoll2 = IntegralRoll;
613
        Mess_IntegralRoll2 = IntegralRoll;
603
        Mess_Integral_Gier2 = Integral_Gier;
614
        Mess_Integral_Gier2 = Integral_Gier;
604
    ANALOG_ON;  // ADC einschalten
615
    ANALOG_ON;  // ADC einschalten
Line 638... Line 649...
638
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                
649
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                
639
 //KompassValue = 12;
650
 //KompassValue = 12;
640
    if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV))
651
    if(KompassValue && (EE_Parameter.GlobalConfig & CFG_KOMPASS_AKTIV))
641
     {
652
     {
642
       int w,v;
653
       int w,v;
643
       static int SignalSchlecht = 0;
-
 
644
       w = abs(IntegralNick /512); // mit zunehmender Neigung den Einfluss drosseln
654
       w = abs(IntegralNick /512); // mit zunehmender Neigung den Einfluss drosseln
645
       v = abs(IntegralRoll /512);
655
       v = abs(IntegralRoll /512);
646
       if(v > w) w = v; // grösste Neigung ermitteln
656
       if(v > w) w = v; // grösste Neigung ermitteln
647
       if(w < 25 && NeueKompassRichtungMerken && !SignalSchlecht)    
657
       if(w < 25 && NeueKompassRichtungMerken && !SignalSchlecht)    
648
        {
658
        {
Line 690... Line 700...
690
    DebugOut.Analog[4] = MesswertGier;
700
    DebugOut.Analog[4] = MesswertGier;
691
    DebugOut.Analog[5] = HoehenWert;
701
    DebugOut.Analog[5] = HoehenWert;
692
    DebugOut.Analog[6] = (Mess_Integral_Hoch / 512);
702
    DebugOut.Analog[6] = (Mess_Integral_Hoch / 512);
693
    DebugOut.Analog[7] = GasMischanteil;
703
    DebugOut.Analog[7] = GasMischanteil;
694
    DebugOut.Analog[8] = KompassValue;
704
    DebugOut.Analog[8] = KompassValue;
-
 
705
    DebugOut.Analog[9] = Mess_Integral_Gier2;
695
//    DebugOut.Analog[9] = SollHoehe;
706
//    DebugOut.Analog[9] = SollHoehe;
696
//    DebugOut.Analog[10] = Mess_Integral_Gier / 128;
707
//    DebugOut.Analog[10] = Mess_Integral_Gier / 128;
697
//    DebugOut.Analog[11] = KompassStartwert;
708
//    DebugOut.Analog[11] = KompassStartwert;
698
//    DebugOut.Analog[10] = Parameter_Gyro_I;    
709
//    DebugOut.Analog[10] = Parameter_Gyro_I;    
699
//    DebugOut.Analog[10] = EE_Parameter.Gyro_I;    
710
//    DebugOut.Analog[10] = EE_Parameter.Gyro_I;