/trunk/fc.c |
---|
79,7 → 79,7 |
volatile long Mess_Integral_Hoch = 0; |
int KompassValue = -1; |
int KompassSollWert = 0; |
int KompassRichtung = 0; |
//int KompassRichtung = 0; |
char CalculateCompassTimer = 100; |
unsigned char KompassFusion = 32; |
unsigned int KompassSignalSchlecht = 50; |
191,7 → 191,7 |
DebugOut.Analog[8] = KompassValue; |
DebugOut.Analog[9] = UBat; |
DebugOut.Analog[10] = SenderOkay; |
DebugOut.Analog[11] = ErsatzKompass / GIER_GRAD_FAKTOR; |
DebugOut.Analog[11] = ErsatzKompassInGrad; |
DebugOut.Analog[12] = Motor[0].SetPoint; |
DebugOut.Analog[13] = Motor[1].SetPoint; |
DebugOut.Analog[14] = Motor[2].SetPoint; |
1269,8 → 1269,9 |
v = abs(IntegralRoll /512); |
if(v > w) w = v; // grösste Neigung ermitteln |
korrektur = w / 4 + 1; |
ErsatzKompassInGrad = ErsatzKompass/GIER_GRAD_FAKTOR; |
// Kompassfehlerwert bestimmen |
fehler = ((540 + KompassValue - (ErsatzKompass/GIER_GRAD_FAKTOR)) % 360) - 180; |
fehler = ((540 + KompassValue - ErsatzKompassInGrad) % 360) - 180; |
// GIER_GRAD_FAKTOR ist ca. 1200 |
// Kompasswert einloggen |
1284,7 → 1285,7 |
if(--NeueKompassRichtungMerken == 0) |
{ |
//--> ErsatzKompass = KompassValue * GIER_GRAD_FAKTOR; |
KompassSollWert = (ErsatzKompass/GIER_GRAD_FAKTOR); |
KompassSollWert = ErsatzKompassInGrad; |
} |
} |
} |
1291,10 → 1292,10 |
// Kompass fusionieren |
if(!KompassSignalSchlecht) ErsatzKompass += (fehler * KompassFusion) / korrektur; |
// MK Gieren |
if(!NeueKompassRichtungMerken) |
// MK Gieren |
if(!NeueKompassRichtungMerken) |
{ |
r = ((540 + (KompassSollWert - ErsatzKompass/GIER_GRAD_FAKTOR)) % 360) - 180; |
r = ((540 + (KompassSollWert - ErsatzKompassInGrad)) % 360) - 180; |
v = r * (Parameter_KompassWirkung/2); // nach Kompass ausrichten |
CompassGierSetpoint = v / 16; |
} |
/trunk/hottmenu.c |
---|
166,7 → 166,7 |
if(FC_StatusFlags & FC_STATUS_LOWBAT) |
HoTT_printfxy_BLINK(0,1," %2i:%02i ",FlugSekunden/60,FlugSekunden%60) |
else HoTT_printfxy(0,1," %2i:%02i ",FlugSekunden/60,FlugSekunden%60); |
HoTT_printfxy(10,1,"DIR: %3d%c",KompassValue, HoTT_GRAD); |
HoTT_printfxy(10,1,"DIR: %3d%c",ErsatzKompassInGrad, HoTT_GRAD); |
if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy(20,1,"C") else HoTT_printfxy(20,1," "); |
break; |
case 2: |
/trunk/jetimenu.c |
---|
24,7 → 24,7 |
JetiBox_printfxy(0,0,"%2i.%1iV",UBat/10, UBat%10); |
if(NaviDataOkay) |
{ |
JetiBox_printfxy(6,0,"%3d%c %03dm%c",KompassValue, 0xDF, GPSInfo.HomeDistance/10,NC_GPS_ModeCharacter); |
JetiBox_printfxy(6,0,"%3d%c %03dm%c",ErsatzKompassInGrad, 0xDF, GPSInfo.HomeDistance/10,NC_GPS_ModeCharacter); |
} |
else |
{ |
/trunk/libfc1284.a |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/libfc644.a |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/menu.c |
---|
48,14 → 48,16 |
LCD_printfxy(0,0,"+ MikroKopter +"); |
LCD_printfxy(0,1,"HW:V%d.%d SW:%d.%d%c",PlatinenVersion/10,PlatinenVersion%10, VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH +'a'); |
LCD_printfxy(0,2,"Setting:%d %s", GetActiveParamSet(),Mixer.Name); |
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
if(NC_ErrorCode) |
{ |
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
LCD_printfxy(0,3,"ERR%2d:",NC_ErrorCode); |
_printf_P(&Menu_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0); |
#else |
LCD_printfxy(0,3,"! NC-ERR: %2d ! ",NC_ErrorCode); |
#endif |
} |
else |
#endif |
if(VersionInfo.HardwareError[0]) LCD_printfxy(0,3,"Hardware Error 1:%d !!",VersionInfo.HardwareError[0]) |
else |
if(MissingMotor) LCD_printfxy(0,3,"Missing BL-Ctrl:%d!!",MissingMotor) |
78,8 → 80,8 |
{ |
LCD_printfxy(0,0,"Height control"); |
LCD_printfxy(0,1,"DISABLED"); |
LCD_printfxy(0,2,"Height control"); |
LCD_printfxy(0,3,"DISABLED"); |
//LCD_printfxy(0,2,"Height control"); |
//LCD_printfxy(0,3,"DISABLED"); |
} |
break; |
87,7 → 89,7 |
LCD_printfxy(0,0,"act. bearing"); |
LCD_printfxy(0,1,"Nick: %5i",IntegralNick/1024); |
LCD_printfxy(0,2,"Roll: %5i",IntegralRoll/1024); |
LCD_printfxy(0,3,"Compass: %5i",KompassValue); |
LCD_printfxy(0,3,"Compass: %5i",ErsatzKompassInGrad); |
break; |
case 3: |
for(i=0;i<8;i+=2) LCD_printfxy(0,i/2,"K%i:%4i K%i:%4i ",i,PPM_in[i+1],i+1,PPM_in[i+2]); |
141,9 → 143,9 |
break; |
case 9: |
LCD_printfxy(0,0,"Compass"); |
LCD_printfxy(0,1,"Heading: %5i",KompassRichtung); |
LCD_printfxy(0,2,"Value: %5i",KompassValue); |
LCD_printfxy(0,3,"Soll: %5i",KompassSollWert); |
LCD_printfxy(0,1,"Magnet: %5i",KompassValue); |
LCD_printfxy(0,2,"Gyro: %5i",ErsatzKompassInGrad); |
LCD_printfxy(0,3,"Setpoint: %5i",KompassSollWert); |
break; |
case 10: |
for(i=0;i<4;i++) LCD_printfxy(0,i,"Poti%i: %3i",i+1,Poti[i]); |
/trunk/spi.c |
---|
296,7 → 296,7 |
// MagVec.z = FromNaviCtrl.MagVecZ; |
if(FromNaviCtrl.CompassValue <= 360) KompassValue = FromNaviCtrl.CompassValue; |
KompassRichtung = ((540 + KompassValue - KompassSollWert) % 360) - 180; |
// KompassRichtung = ((540 + KompassValue - KompassSollWert) % 360) - 180; |
if(FromNaviCtrl.BeepTime > beeptime /*&& !WinkelOut.CalcState*/) beeptime = FromNaviCtrl.BeepTime; |
#define FLAG_GPS_AID 0x01 |
/trunk/timer0.c |
---|
82,7 → 82,7 |
{ |
cntKompass += cntKompass / 41; |
if(cntKompass > 10) KompassValue = cntKompass - 10; else KompassValue = 0; |
KompassRichtung = ((540 + KompassValue - KompassSollWert) % 360) - 180; |
// KompassRichtung = ((540 + KompassValue - KompassSollWert) % 360) - 180; |
} |
cntKompass = 0; |
} |
/trunk/uart.c |
---|
338,7 → 338,7 |
{ |
case 'K':// Kompasswert |
memcpy((unsigned char *)&KompassValue , (unsigned char *)pRxData, sizeof(KompassValue)); |
KompassRichtung = ((540 + KompassValue - KompassSollWert) % 360) - 180; |
// KompassRichtung = ((540 + KompassValue - KompassSollWert) % 360) - 180; |
break; |
case 't':// Motortest |
if(AnzahlEmpfangsBytes > 20) memcpy(&MotorTest[0], (unsigned char *)pRxData, sizeof(MotorTest)); |
545,7 → 545,7 |
// 'K' comand placed here only for compatibility to old MK3MAG software, that does not send the right Slave Address |
case 'K':// Kompasswert |
memcpy((unsigned char *)&KompassValue , (unsigned char *)pRxData, sizeof(KompassValue)); |
KompassRichtung = ((540 + KompassValue - KompassSollWert) % 360) - 180; |
// KompassRichtung = ((540 + KompassValue - KompassSollWert) % 360) - 180; |
break; |
case 'a':// Texte der Analogwerte |
DebugTextAnforderung = pRxData[0]; |
/trunk/version.txt |
---|
491,3 → 491,5 |
- neue Fehlermeldung: "GPS Fix lost" |
- LED: Schaltfläche "nur bei Motor start" bei beiden getrennt |
- Ausbau der HoTT-Telemetrie |
- Variable "KompassRichtung" entfernt |
- ErsatzKompassInGrad sinvoll genutzt |