Rev 273 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 273 | Rev 393 | ||
---|---|---|---|
Line 49... | Line 49... | ||
49 | 49 | ||
50 | long GPS_Positionsabweichung_North = 0; |
50 | long GPS_Positionsabweichung_North = 0; |
51 | long GPS_Positionsabweichung_East = 0; |
51 | long GPS_Positionsabweichung_East = 0; |
52 | long GPS_Geschwindigkeit_North = 0; |
52 | long GPS_Geschwindigkeit_North = 0; |
- | 53 | long GPS_Geschwindigkeit_East = 0; |
|
53 | long GPS_Geschwindigkeit_East = 0; |
54 | signed int GPS_StickSense = 12; |
54 | long P_Einfluss_North = 0; |
55 | long P_Einfluss_North = 0; |
55 | long D_Einfluss_North = 0; |
56 | long D_Einfluss_North = 0; |
56 | long P_Einfluss_East = 0; |
57 | long P_Einfluss_East = 0; |
Line 69... | Line 70... | ||
69 | 70 | ||
70 | //**************************** MIRCOS DEFINITIONSANFANG FÜR DIE FILTERUNG |
71 | //**************************** MIRCOS DEFINITIONSANFANG FÜR DIE FILTERUNG |
Line 71... | Line 72... | ||
71 | // Filterung der GPS Messwerte vom Ublox-Empfänger. Es wird der gleitende Durchschnitt aus n Messwerten gebildet |
72 | // Filterung der GPS Messwerte vom Ublox-Empfänger. Es wird der gleitende Durchschnitt aus n Messwerten gebildet |
72 | 73 | ||
73 | #define MITTELWERTZAHL 8 // Anzahl der Messwerte fuer gleitenden Mittelwert |
74 | #define MITTELWERTZAHL 8 // Anzahl der Messwerte fuer gleitenden Mittelwert |
74 | volatile char NeuerMittelwert = 0; //Flag ob ein neuer Mittelwert vorliegt, der mit 4 Hz berechnet wird, da nur dann neue Messwerte vom GPS vorliegen |
75 | volatile char NeuerMittelwert = 0; //Flag ob ein neuer Mittelwert vorliegt, der mit GPS Frequenz berechnet wird, da nur dann neue Messwerte vom GPS vorliegen |
75 | volatile unsigned char FilterPos = 0; |
76 | volatile unsigned char FilterPos = 0; |
76 | volatile long NORTH_MITTEL = 0; |
77 | volatile long NORTH_MITTEL = 0; |
77 | volatile long EAST_MITTEL = 0; |
78 | volatile long EAST_MITTEL = 0; |
Line 192... | Line 193... | ||
192 | LED2_OFF; |
193 | LED2_OFF; |
193 | } |
194 | } |
Line 194... | Line 195... | ||
194 | 195 | ||
195 | 196 | ||
196 | // wenn 3D-Fix, Schalter im mittleren Bereich und vom Pilot gesteuert wird, wird ständig neue GPS-Sollposition eingelernt |
197 | // wenn 3D-Fix, Schalter im mittleren Bereich und vom Pilot gesteuert wird, wird ständig neue GPS-Sollposition eingelernt |
197 | if(actualPos.GPSFix == 3 && Poti3 > 70 && Poti3 < 150 && (StickNick > 12 || StickNick < -12 || StickRoll > 12 || StickRoll < -12)) |
198 | if(actualPos.GPSFix == 3 && Poti3 > 70 && Poti3 < 150 && (StickNick > GPS_StickSense || StickNick < -GPS_StickSense || StickRoll > GPS_StickSense || StickRoll < -GPS_StickSense)) |
198 | { |
199 | { |
Line 199... | Line 200... | ||
199 | GPS_Nick = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
200 | GPS_Nick = 0; //wird genullt, damit das letzte GPS Kommando nicht ständig gegen den Piloten ansteuert |
Line 214... | Line 215... | ||
214 | //++++++++++++++++++++++++++++++++++++ |
215 | //++++++++++++++++++++++++++++++++++++ |
215 | } |
216 | } |
Line 216... | Line 217... | ||
216 | 217 | ||
217 | 218 | ||
218 | // wenn 3D-Fix, Schalter im mittleren Bereich (oder höher), neuer Mittelwert vorhanden, wenigstens einmal Sollposition gelernt und der Pilot nicht selbst steuert wird eine GPS-Funktion aktiviert |
219 | // wenn 3D-Fix, Schalter im mittleren Bereich (oder höher), neuer Mittelwert vorhanden, wenigstens einmal Sollposition gelernt und der Pilot nicht selbst steuert wird eine GPS-Funktion aktiviert |
219 | if (actualPos.GPSFix == 3 && Poti3 > 70 && NeuerMittelwert == 1 && Soll_Position_North != 0 && Soll_Position_East != 0 && StickNick <= 12 && StickNick >= -12 && StickRoll <= 12 && StickRoll >= -12) |
220 | if (actualPos.GPSFix == 3 && Poti3 > 70 && NeuerMittelwert == 1 && Soll_Position_North != 0 && Soll_Position_East != 0 && StickNick <= GPS_StickSense && StickNick >= -GPS_StickSense && StickRoll <= GPS_StickSense && StickRoll >= -GPS_StickSense) |
Line 220... | Line 221... | ||
220 | { |
221 | { |
221 | //Berechnung der GPS-Positionsabweichung je nach aktivierter GPS-Funktion (GPS_HOLD oder HOMING) |
222 | //Berechnung der GPS-Positionsabweichung je nach aktivierter GPS-Funktion (GPS_HOLD oder HOMING) |