/trunk/eeprom.c |
---|
51,7 → 51,6 |
// + Note: For information on license extensions (e.g. commercial use), please contact us at info(@)hisystems.de. |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#ifndef EEMEM |
#define EEMEM __attribute__ ((section (".eeprom"))) |
#endif |
/trunk/fc.c |
---|
90,7 → 90,7 |
unsigned char TrichterFlug = 0; |
long Umschlag180Nick = 250000L, Umschlag180Roll = 250000L; |
long ErsatzKompass; |
int ErsatzKompassInGrad; // Kompasswert in Grad |
int ErsatzKompassInGrad, CompassCorrected; // Kompasswert in Grad |
int GierGyroFehler = 0; |
char GyroFaktor,GyroFaktorGier; |
char IntegralFaktor,IntegralFaktorGier; |
217,7 → 217,7 |
DebugOut.Analog[22] = Capacity.ActualCurrent; |
DebugOut.Analog[23] = Capacity.UsedCapacity; |
DebugOut.Analog[24] = SollHoehe/10; |
DebugOut.Analog[27] = KompassSollWert; |
// DebugOut.Analog[27] = KompassSollWert; |
DebugOut.Analog[29] = Capacity.MinOfMaxPWM; |
DebugOut.Analog[30] = GPS_Nick; |
DebugOut.Analog[31] = GPS_Roll; |
260,7 → 260,6 |
void CalibrierMittelwert(void) |
//############################################################################ |
{ |
unsigned char i; |
// if(PlatinenVersion == 13) SucheGyroOffset(); |
// ADC auschalten, damit die Werte sich nicht während der Berechnung ändern |
ANALOG_OFF; |
271,13 → 270,6 |
Mittelwert_AccRoll = ACC_AMPLIFY * AdWertAccRoll; |
// ADC einschalten |
ANALOG_ON; |
for(i=0;i<8;i++) |
{ |
int tmp; |
tmp = PPM_in[EE_Parameter.Kanalbelegung[K_POTI1 + i]] + 127; |
LIMIT_MIN_MAX(tmp, 0, 255); |
if(Poti[i] > tmp) Poti[i]--; else if(Poti[i] < tmp) Poti[i]++; |
} |
Umschlag180Nick = (long) EE_Parameter.WinkelUmschlagNick * 2500L; |
Umschlag180Roll = (long) EE_Parameter.WinkelUmschlagRoll * 2500L; |
} |
310,9 → 302,12 |
CalibrierMittelwert(); |
Delay_ms_Mess(100); |
CalibrierMittelwert(); |
DebugOut.Analog[16] = 0; |
DebugOut.Analog[17] = 0; |
if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
{ |
if((MessLuftdruck > 950) || (MessLuftdruck < 750) || ExpandBaro) SucheLuftruckOffset(); |
389,10 → 384,6 |
FromNaviCtrl_Value.Kalman_K = -1; |
FromNaviCtrl_Value.Kalman_MaxDrift = 0; |
FromNaviCtrl_Value.Kalman_MaxFusion = 32; |
for(i=0;i<8;i++) |
{ |
Poti[i] = PPM_in[EE_Parameter.Kanalbelegung[K_POTI1 + i]] + 127; |
} |
SenderOkay = 100; |
if(ServoActive) DDRD |=0x80; // enable J7 -> Servo signal |
1382,6 → 1373,10 |
Mess_IntegralNick -= tmp_long; |
Mess_IntegralRoll -= tmp_long2; |
DebugOut.Analog[16] += tmp_long; |
DebugOut.Analog[17] += tmp_long2; |
} |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
if(ZaehlMessungen >= ABGLEICH_ANZAHL) |
2273,7 → 2268,7 |
} |
} |
#ifdef REDUNDANT_FC_MASTER |
if(Parameter_UserParam6 > 200 && RedundanceBlOperation) Motor[0].SetPoint = 0; |
if(Parameter_UserParam6 > 230) Motor[0].SetPoint = 0; |
#endif |
} |
//DebugOut.Analog[16] |
/trunk/fc.h |
---|
81,7 → 81,7 |
extern unsigned char ControlHeading; |
extern int TrimNick, TrimRoll; |
extern long ErsatzKompass; |
extern int ErsatzKompassInGrad; // Kompasswert in Grad |
extern int ErsatzKompassInGrad,CompassCorrected; // Kompasswert in Grad |
extern long HoehenWert; |
extern long SollHoehe; |
extern long FromNC_AltitudeSetpoint; |
/trunk/hottmenu.c |
---|
450,7 → 450,7 |
ElectricAirPacket.Altitude = HoehenWert/100 + 500; |
ElectricAirPacket.Battery1 = UBat; |
ElectricAirPacket.Battery2 = UBat; |
ElectricAirPacket.VoltageCell1 = ErsatzKompassInGrad / 2; |
ElectricAirPacket.VoltageCell1 = CompassCorrected / 2; |
ElectricAirPacket.VoltageCell8 = ElectricAirPacket.VoltageCell1; |
ElectricAirPacket.VoltageCell6 = GPSInfo.HomeBearing / 2; |
ElectricAirPacket.VoltageCell7 = GPSInfo.HomeDistance/20; |
473,7 → 473,7 |
case HOTT_GENERAL_PACKET_ID: |
GetHottestBl(); |
HoTTGeneral.Rpm = GPSInfo.HomeDistance/100; |
HoTTGeneral.VoltageCell1 = ErsatzKompassInGrad / 2; |
HoTTGeneral.VoltageCell1 = CompassCorrected / 2; |
HoTTGeneral.VoltageCell2 = KompassValue / 2; |
//HoTTGeneral.VoltageCell3 = Magnetstaerke -> macht NC |
//HoTTGeneral.VoltageCell4 = Inclinition -> macht NC |
535,7 → 535,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",ErsatzKompassInGrad, HoTT_GRAD); |
HoTT_printfxy(10,1,"DIR: %3d%c",CompassCorrected, HoTT_GRAD); |
if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(20,1,"C") else HoTT_printfxy(20,1," "); |
break; |
case 2: |
636,7 → 636,7 |
else HoTT_printfxy(0,0," %2i:%02i %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity); |
break; |
case 1: |
HoTT_printfxy(0,1,"DIR:%3d%c",KompassValue, HoTT_GRAD); |
HoTT_printfxy(0,1,"DIR:%3d%c",CompassCorrected, HoTT_GRAD); |
if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
if(HoehenReglerAktiv) HoTT_printfxy_INV(10,1,"ALT:%4im", (int16_t)(HoehenWert/100)) |
/trunk/jetimenu.c |
---|
77,7 → 77,7 |
JetiBox_printfxy(0,0,"%2i.%1iV",UBat/10, UBat%10); |
if(NaviDataOkay) |
{ |
JetiBox_printfxy(6,0,"%3d%c %03dm%c",ErsatzKompassInGrad, 0xDF, GPSInfo.HomeDistance/10,NC_GPS_ModeCharacter); |
JetiBox_printfxy(6,0,"%3d%c %03dm%c",CompassCorrected, 0xDF, GPSInfo.HomeDistance/10,NC_GPS_ModeCharacter); |
} |
else |
{ |
118,6 → 118,8 |
{ |
JetiBox_printfxy(10,1,"%4im%c", (int16_t)(HoehenWert/100),VarioCharacter); |
} |
if(RedundanceBlOperation) JetiBox_printfxy(10,1,"R"); |
#endif |
} |
/trunk/libfc1284.a |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/main.c |
---|
247,10 → 247,17 |
PrintLine();// ("\n\r==================================="); |
if(RequiredMotors < FoundMotors) VersionInfo.HardwareError[1] |= FC_ERROR1_MIXER; |
if(RequiredMotors > 8) Max_I2C_Packets = 8; else Max_I2C_Packets = RequiredMotors; |
#else |
printf("\n\r--> REDUNDANT SLAVE <---"); |
#endif |
#ifdef REDUNDANT_FC_MASTER |
printf("\n\r--> REDUNDANT MASTER <---"); |
#endif |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// Calibrating altitude sensor |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
#endif |
//if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
{ |
printf("\n\rCalibrating pressure sensor.."); |
456,6 → 463,19 |
if(++second == 49) |
{ |
second = 0; |
/* |
DebugOut.Analog[16] -= DebugOut.Analog[16] / 128; |
DebugOut.Analog[17] -= DebugOut.Analog[17] / 128; |
if(DebugOut.Analog[16] > 3000) {AdNeutralNick++; DebugOut.Analog[16] = 0;} |
else |
if(DebugOut.Analog[16] < -3000) {AdNeutralNick--; DebugOut.Analog[16] = 0;}; |
if(DebugOut.Analog[17] > 3000) {AdNeutralRoll++; DebugOut.Analog[17] = 0;} |
else |
if(DebugOut.Analog[17] < -3000) {AdNeutralRoll--; DebugOut.Analog[17] = 0;}; |
*/ |
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
if(ShowSettingNameTime) ShowSettingNameTime--; |
#endif |
/trunk/makefile |
---|
6,10 → 6,10 |
#------------------------------------------------------------------- |
VERSION_MAJOR = 2 |
VERSION_MINOR = 04 |
VERSION_PATCH = 0 |
VERSION_PATCH = 2 |
VERSION_SERIAL_MAJOR = 11 # Serial Protocol to KopterTool -> do not change! |
VERSION_SERIAL_MINOR = 0 # Serial Protocol |
NC_SPI_COMPATIBLE = 60 # Navi-Kompatibilität |
NC_SPI_COMPATIBLE = 61 # Navi-Kompatibilität |
LIB_FC_COMPATIBLE = 6 # Library |
#------------------------------------------------------------------- |
# ATMEGA644: 63487 is maximum |
/trunk/menu.c |
---|
139,7 → 139,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",ErsatzKompassInGrad); |
LCD_printfxy(0,3,"Compass: %5i",CompassCorrected); |
break; |
case 3: |
for(i=1;i<9;i+=2) LCD_printfxy(0,i/2,"K%i:%4i K%i:%4i ",i,PPM_in[i],i+1,PPM_in[i+1]); |
154,7 → 154,10 |
LCD_printfxy(0,0,"Gyro - Sensor"); |
LCD_printfxy(0,1,"Nick %4i (%3i.%x)",AdWertNick - AdNeutralNick/8, AdNeutralNick/16, (AdNeutralNick%16)/2); |
LCD_printfxy(0,2,"Roll %4i (%3i.%x)",AdWertRoll - AdNeutralRoll/8, AdNeutralRoll/16, (AdNeutralRoll%16)/2); |
// LCD_printfxy(0,1,"Nick %4i (%4i)",AdWertNickFilter, AdNeutralNick); |
// LCD_printfxy(0,2,"Roll %4i (%4i)",AdWertRollFilter, AdNeutralRoll); |
LCD_printfxy(0,3,"Yaw %4i (%3i)",AdNeutralGier - AdWertGier, AdNeutralGier/2); |
/* |
// entfernt aus Platzmangel |
if(PlatinenVersion == 10) |
224,7 → 227,7 |
LCD_printfxy(0,0,"Compass"); |
LCD_printfxy(0,1,"Magnet: %5i",KompassValue); |
LCD_printfxy(0,2,"Gyro: %5i",ErsatzKompassInGrad); |
LCD_printfxy(0,3,"Setpoint: %5i",KompassSollWert); |
LCD_printfxy(0,3,"True: %5i",CompassCorrected); |
break; |
case 14: |
LCD_printfxy(0,0,"Servo " ); |
/trunk/spi.c |
---|
374,6 → 374,7 |
NaviData_WaypointNumber = FromNaviCtrl.Param.Byte[5]; |
NaviData_TargetHoldTime = FromNaviCtrl.Param.Byte[8]; |
NaviData_MaxWpListIndex = FromNaviCtrl.Param.Byte[9]; |
CompassCorrected = FromNaviCtrl.Param.sInt[5]; // Bytes 10 & 11 |
break; |
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
/trunk/uart.c |
---|
139,7 → 139,7 |
"Height Setpoint ", |
"25 ", //25 |
"26 ", //"26 CPU OverLoad ", |
"Compass Setpoint", |
"27 ", |
"I2C-Error ", |
"BL Limit ", |
"GPS_Nick ", //30 |
572,6 → 572,7 |
switch(RxdBuffer[2]) |
{ |
#ifdef REDUNDANT_FC_SLAVE |
static unsigned int clear_I; |
case '?':// Serielle Antwort eines BL-Reglers |
tempchar1 = RxdBuffer[1] - ('a'+11); |
578,12 → 579,13 |
if(tempchar1 >= MAX_MOTORS) break; |
memcpy((unsigned char *)&RedundantMotor[tempchar1], (unsigned char *)pRxData, sizeof(RedundantBl_t)); |
if(RedundantMotor[tempchar1].BitSate & BL_BIT_STATE_I2C_OK && clear_I) clear_I--; |
if(!(RedundantMotor[tempchar1].BitSate & BL_BIT_STATE_I2C_OK)) ROT_FLASH; |
GRN_FLASH; |
if(RedundantMotor[tempchar1].BitSate & BL_BIT_STATE_I2C_BAD) |
{ |
ROT_ON; |
if(clear_I == 0) |
{ |
PORTB |= 0x02; |
SummeNick = 0; |
SummeRoll = 0; |
Mess_Integral_Gier = 0; |
590,11 → 592,11 |
} |
clear_I = 500; |
} |
else PORTB &=~0x02; |
//DebugOut.Analog[16] = RedundantMotor[tempchar1].BitSate; |
//DebugOut.Analog[17]++; |
//DebugOut.Analog[18] = tempchar1; |
break; |
#endif |
// 't' comand placed here only for compatibility to BL |
case 't':// Motortest |
if(AnzahlEmpfangsBytes >= sizeof(MotorTest)) memcpy(&MotorTest[0], (unsigned char *)pRxData, sizeof(MotorTest)); |
/trunk/version.txt |
---|
683,7 → 683,16 |
- Auto-Start & Landing |
- WP-List Name |
2.04b |
- Bugfix: Poti Values were wrong after calibration |
- Redundant Slave: LED-Binking: Green: UART Data & Red:I2C error |
- CompassCorrected in HoTT- und Jeti-Display |
- "True Compass" in virtual menu |
- Jeti: Indicator "R" for redundancy |