Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 1942 → Rev 1943

/trunk/fc.c
94,10 → 94,10
char IntegralFaktor,IntegralFaktorGier;
int DiffNick,DiffRoll;
int StickGasHover = 120, HoverGasMin = 0, HoverGasMax = 1023;
int StickNick = 0,StickRoll = 0,StickGier = 0,StickGas = 0;
//int Poti1 = 0, Poti2 = 0, Poti3 = 0, Poti4 = 0, Poti5 = 0, Poti6 = 0, Poti7 = 0, Poti8 = 0;
unsigned char Poti[9] = {0,0,0,0,0,0,0,0};
volatile unsigned char SenderOkay = 0;
int StickNick = 0,StickRoll = 0,StickGier = 0,StickGas = 0;
char MotorenEin = 0,StartTrigger = 0;
long HoehenWert = 0;
long SollHoehe = 0;
208,9 → 208,6
DebugOut.Analog[30] = GPS_Nick;
DebugOut.Analog[31] = GPS_Roll;
if(VersionInfo.HardwareError[0] || VersionInfo.HardwareError[1]) DebugOut.Status[1] |= 1; else DebugOut.Status[1] &= 0xfe;
 
DebugOut.Analog[16] = AltitudeSetpointTrimming;
DebugOut.Analog[17] = ElectricAirPacket.m_sec;
}
 
 
1463,7 → 1460,7
// PD-Control with respect to hoover point
// the thrust loss out of horizontal attitude is compensated
// the setpoint will be fine adjusted with the gas stick position
if(1 || FC_StatusFlags & FC_STATUS_FLY) // trim setpoint only when flying
if(FC_StatusFlags & FC_STATUS_FLY) // trim setpoint only when flying
{ // gas stick is above hoover point
if(StickGas > (StickGasHover + HEIGHT_CONTROL_STICKTHRESHOLD) && !BaroAtUpperLimit)
{
/trunk/fc.h
90,6 → 90,7
extern void CopyDebugValues(void);
 
extern unsigned char h,m,s;
extern int StickNick,StickRoll,StickGier,StickGas;
extern volatile unsigned char Timeout ;
extern unsigned char CosinusNickWinkel, CosinusRollWinkel;
extern int DiffNick,DiffRoll;
/trunk/hottmenu.c
21,6 → 21,12
#define HoTT_OBEN 125
#define HoTT_UNTEN 126
 
GPSPacket_t GPSPacket;
VarioPacket_t VarioPacket;
ASCIIPacket_t ASCIIPacket;
ElectricAirPacket_t ElectricAirPacket;
HoTTGeneral_t HoTTGeneral;
 
const char PROGMEM NC_ERROR_TEXT[MAX_ERR_NUMBER][17] =
{
//0123456789123456
48,6 → 54,28
"GPS Fix lost \0" // 21
};
 
unsigned char MaxBlTempertaure = 0;
unsigned char MinBlTempertaure = 0;
unsigned char HottestBl = 0;
 
void GetHottestBl(void)
{
static unsigned char search = 0,tmp_max,tmp_min,who;
if(Motor[search].Temperature > tmp_max) { tmp_max = Motor[search].Temperature; who = search;}
else
if(Motor[search].Temperature) if(Motor[search].Temperature < tmp_min) tmp_min = Motor[search].Temperature;
if(++search > MAX_MOTORS)
{
search = 0;
if(tmp_min != 255) MinBlTempertaure = tmp_min; else MinBlTempertaure = 0;
MaxBlTempertaure = tmp_max;
HottestBl = who;
tmp_min = 255;
tmp_max = 0;
who = 0;
}
}
 
//---------------------------------------------------------------
void Hott_ClearLine(unsigned char line)
{
81,6 → 109,10
ptr = (unsigned char *) &ElectricAirPacket;
max = sizeof(ElectricAirPacket);
break;
case HOTT_GENERAL_PACKET_ID:
ptr = (unsigned char *) &HoTTGeneral;
max = sizeof(HoTTGeneral);
break;
}
z = FromNaviCtrl.Param.Byte[0]; // Data allocation
 
103,21 → 135,21
else
if(WaypointTrimming > 0) tmp = 30000 + FromNC_AltitudeSpeed * 10;
else tmp = 30000 - FromNC_AltitudeSpeed * 10;
//tmp = 30000 + (int)(PPM_in[EE_Parameter.Kanalbelegung[K_GAS]]) * 5;
return(tmp);
}
 
 
//---------------------------------------------------------------
unsigned char HoTT_Telemety(unsigned char packet_request)
{
static unsigned char search = 0,max,min,tmp_max,tmp_min;
 
switch(packet_request)
{
case HOTT_VARIO_PACKET_ID:
VarioPacket.Altitude = HoehenWert/100 + 500;
VarioPacket.m_sec = BuildHoTT_Vario();
GPSPacket.m_3sec = 120;
GPSPacket.m_10sec = 120;
VarioPacket.m_3sec = VarioPacket.m_sec;
VarioPacket.m_10sec = VarioPacket.m_sec;
if (VarioPacket.Altitude < VarioPacket.MinAltitude) VarioPacket.MinAltitude = VarioPacket.Altitude;
if (VarioPacket.Altitude > VarioPacket.MaxAltitude) VarioPacket.MaxAltitude = VarioPacket.Altitude;
VarioPacket.WarnBeep = HoTT_Waring();
127,9 → 159,9
 
case HOTT_GPS_PACKET_ID:
GPSPacket.Altitude = HoehenWert/100 + 500;
// GPSPacket.Distance = GPSInfo.HomeDistance/10;
// GPSPacket.Heading = GPSInfo.HomeBearing/2;//KompassValue/2;
// GPSPacket.Speed = (GPSInfo.Speed * 36) / 10;
// GPSPacket.Distance = GPSInfo.HomeDistance/10; // macht die NC
// GPSPacket.Heading = GPSInfo.HomeBearing/2; // macht die NC
// GPSPacket.Speed = (GPSInfo.Speed * 36) / 10; // macht die NC
GPSPacket.m_sec = BuildHoTT_Vario();
GPSPacket.m_3sec = 120;
GPSPacket.m_10sec = 0;
138,26 → 170,19
return(sizeof(GPSPacket));
break;
case HOTT_ELECTRIC_AIR_PACKET_ID:
 
if(Motor[search].Temperature > tmp_max) tmp_max = Motor[search].Temperature;
else
if(Motor[search].Temperature) if(Motor[search].Temperature < tmp_min) tmp_min = Motor[search].Temperature;
if(++search > MAX_MOTORS)
{
search = 0;
if(tmp_min != 255) min = tmp_min; else min = 0;
max = tmp_max;
tmp_min = 255;
tmp_max = 0;
}
GetHottestBl();
ElectricAirPacket.Altitude = HoehenWert/100 + 500;
ElectricAirPacket.Battery1 = UBat;
ElectricAirPacket.Battery2 = UBat;
ElectricAirPacket.VoltageCell1 = ErsatzKompassInGrad / 2;
ElectricAirPacket.VoltageCell8 = ElectricAirPacket.VoltageCell1;
ElectricAirPacket.VoltageCell7 = GPSInfo.HomeDistance/20;
ElectricAirPacket.VoltageCell14 = ElectricAirPacket.VoltageCell7;
ElectricAirPacket.m_sec = BuildHoTT_Vario();
ElectricAirPacket.m_3sec = 120;
ElectricAirPacket.InputVoltage = UBat;
ElectricAirPacket.Temperature1 = min + 20;
ElectricAirPacket.Temperature2 = max + 20;
ElectricAirPacket.Temperature1 = MinBlTempertaure + 20;
ElectricAirPacket.Temperature2 = MaxBlTempertaure + 20;
ElectricAirPacket.Capacity = Capacity.UsedCapacity/10;
ElectricAirPacket.WarnBeep = HoTT_Waring();
ElectricAirPacket.Current = Capacity.ActualCurrent;
164,6 → 189,28
HoTT_DataPointer = (unsigned char *) &ElectricAirPacket;
return(sizeof(ElectricAirPacket));
break;
case HOTT_GENERAL_PACKET_ID:
GetHottestBl();
HoTTGeneral.Rpm = GPSInfo.HomeDistance/100;
HoTTGeneral.VoltageCell1 = ErsatzKompassInGrad / 2;
HoTTGeneral.VoltageCell5 = GPSInfo.HomeDistance/20;
if(UBat > BattLowVoltageWarning + 5) HoTTGeneral.FuelPercent = (UBat - (BattLowVoltageWarning + 6)) * 3;
else HoTTGeneral.FuelPercent = 0;
HoTTGeneral.FuelCapacity = HoehenWert/100; ;
HoTTGeneral.Altitude = HoehenWert/100 + 500;
HoTTGeneral.Battery1 = UBat;
HoTTGeneral.Battery2 = UBat;
HoTTGeneral.m_sec = BuildHoTT_Vario();
HoTTGeneral.m_3sec = 120;
HoTTGeneral.InputVoltage = UBat;
HoTTGeneral.Temperature1 = MinBlTempertaure + 20;
HoTTGeneral.Temperature2 = MaxBlTempertaure + 20;
HoTTGeneral.Capacity = Capacity.UsedCapacity/10;
HoTTGeneral.WarnBeep = HoTT_Waring();
HoTTGeneral.Current = Capacity.ActualCurrent;
HoTT_DataPointer = (unsigned char *) &HoTTGeneral;
return(sizeof(HoTTGeneral));
break;
default: return(0);
}
}
222,7 → 269,7
else HoTT_printfxy(7,4,"3D");
break;
default:
HoTT_printfxy(7,4,"! ");
HoTT_printfxy_BLINK(7,4,"!!");
break;
}
}
/trunk/hottmenu.h
33,6 → 33,35
unsigned char VoltageCell4; //
unsigned char VoltageCell5; //
unsigned char VoltageCell6; //
unsigned int Battery1; // 51 = 5,1V
unsigned int Battery2; // 51 = 5,1V
unsigned char Temperature1; // 44 = 24°C, 0 = -20°C
unsigned char Temperature2; // 44 = 24°C, 0 = -20°C
unsigned char FuelPercent;
unsigned int FuelCapacity;
unsigned int Rpm;
unsigned int Altitude;
unsigned int m_sec; // 3000 = 0
unsigned char m_3sec; // 120 = 0
unsigned int Current; // 1 = 0.1A
unsigned int InputVoltage; // 66 = 6,6V
unsigned int Capacity; // 1 = 10mAh
unsigned char NullByte1; // 0x00
unsigned char NullByte2; // 0x00
unsigned char EndByte; // 0x7D
} HoTTGeneral_t;
 
typedef struct
{
unsigned char StartByte; // 0x7C
unsigned char Packet_ID; // HOTT_ELECTRIC_AIR_PACKET_ID
unsigned char WarnBeep; // Anzahl der Töne 0..36
unsigned char VoltageCell1; // 208 = 4,16V (Voltage * 50 = Wert)
unsigned char VoltageCell2; // 209 = 4,18V
unsigned char VoltageCell3; //
unsigned char VoltageCell4; //
unsigned char VoltageCell5; //
unsigned char VoltageCell6; //
unsigned char VoltageCell7; //
unsigned char VoltageCell8; //
unsigned char VoltageCell9; //
49,13 → 78,14
unsigned int Current; // 1 = 0.1A
unsigned int InputVoltage; // 66 = 6,6V
unsigned int Capacity; // 1 = 10mAh
unsigned int m_sec; // 3000 = 0
unsigned int m_3sec; // 3000 = 0
unsigned int m_sec; // 30000 = 0
unsigned int m_3sec; // 120 = 0
unsigned char NullByte1; // 0x00
unsigned char NullByte2; // 0x00
unsigned char EndByte; // 0x7D
} ElectricAirPacket_t;
 
 
typedef struct
{
unsigned char StartByte; // 0x7C
64,9 → 94,9
unsigned int Altitude; // 500 = 0m
unsigned int MaxAltitude; // 500 = 0m
unsigned int MinAltitude; // 500 = 0m
unsigned int m_sec; // 3000 = 0
unsigned int m_3sec; // 3000 = 0
unsigned int m_10sec; // 3000 = 0
unsigned int m_sec; // 30000 = 0
unsigned int m_3sec; // 30000 = 0
unsigned int m_10sec; //
unsigned char NullByte; // 0x00
unsigned char EndByte; // 0x7D
} VarioPacket_t;
91,8 → 121,8
unsigned int Distance; //16+17 // 9000 = 0m
unsigned int Altitude; //18+19 // 500 = 0m
unsigned int m_sec; //20+21 // 3000 = 0
unsigned int m_3sec; //22+23 // 3000 = 0
unsigned int m_10sec; //24+25 // 3000 = 0
unsigned int m_3sec; // 120 = 0
unsigned int m_10sec; //
unsigned char NullByte; // 0x00
unsigned char NullByte1; // 0x00
unsigned char EndByte; // 0x7D
113,10 → 143,12
extern VarioPacket_t VarioPacket;
extern ASCIIPacket_t ASCIIPacket;
extern ElectricAirPacket_t ElectricAirPacket;
extern HoTTGeneral_t HoTTGeneral;
 
#define HOTT_VARIO_PACKET_ID 0x89
#define HOTT_GPS_PACKET_ID 0x8A
#define HOTT_VARIO_PACKET_ID 0x89
#define HOTT_GPS_PACKET_ID 0x8A
#define HOTT_ELECTRIC_AIR_PACKET_ID 0x8E
#define HOTT_GENERAL_PACKET_ID 0x8D
 
#endif
#endif
/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/version.txt
494,4 → 494,7
- Variable "KompassRichtung" entfernt
- ErsatzKompassInGrad sinvoll genutzt
- HoTT-Update per Uart-Durchschleifen
- AltitudeSetpointTrimming eingeführt
- AltitudeSetpointTrimming eingeführt
- Vario-Anzeige für HoTT