Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2007 → Rev 2008

/trunk/analog.c
13,7 → 13,6
volatile int HiResNick = 2500, HiResRoll = 2500;
volatile int AdWertNick = 0, AdWertRoll = 0, AdWertGier = 0;
volatile int AdWertAccRoll = 0,AdWertAccNick = 0,AdWertAccHoch = 0;
volatile char messanzahl_AccHoch = 0;
volatile long Luftdruck = 32000;
volatile long SummenHoehe = 0;
volatile int StartLuftdruck;
24,9 → 23,8
volatile unsigned int ZaehlMessungen = 0;
unsigned char AnalogOffsetNick = 115,AnalogOffsetRoll = 115,AnalogOffsetGier = 115;
volatile unsigned char AdReady = 1;
float NeutralAccZ_float;
 
//#######################################################################################
//
void ADC_Init(void)
//#######################################################################################
{
207,7 → 205,7
if(subcount < -100) { NeutralAccZ--; subcount += 100;}
}
}
messanzahl_AccHoch = 1;
// messanzahl_AccHoch = 1;
Aktuell_az = ADC;
Mess_Integral_Hoch += AdWertAccHoch; // Integrieren
Mess_Integral_Hoch -= Mess_Integral_Hoch / 1024; // dämfen
/trunk/eeprom.c
135,8 → 135,10
EE_Parameter.WinkelUmschlagRoll = 85;
}
EE_Parameter.GyroAccAbgleich = 32; // 1/k
EE_Parameter.BitConfig = 0; // Looping usw.
EE_Parameter.GlobalConfig = CFG_ACHSENKOPPLUNG_AKTIV | CFG_KOMPASS_AKTIV | CFG_GPS_AKTIV | CFG_HOEHEN_SCHALTER;
EE_Parameter.ExtraConfig = CFG_GPS_AID | CFG2_VARIO_BEEP;
EE_Parameter.GlobalConfig3 = 0;
EE_Parameter.Receiver = RECEIVER_JETI;
EE_Parameter.MotorSafetySwitch = 0;
EE_Parameter.ExternalControl = 0;
190,7 → 192,6
EE_Parameter.LoopGasLimit = 50;
EE_Parameter.LoopThreshold = 90; // Wert: 0-247 Schwelle für Stickausschlag
EE_Parameter.LoopHysterese = 50;
EE_Parameter.BitConfig = 0; // Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
 
EE_Parameter.NaviGpsModeControl = 254; // 254 -> Poti 2
EE_Parameter.NaviGpsGain = 100;
219,6 → 220,7
EE_Parameter.MaxAltitude = 150; // 0 = off
EE_Parameter.AchsKopplung1 = 90;
EE_Parameter.AchsKopplung2 = 55;
EE_Parameter.FailsafeChannel = 0;
}
/*
void ParamSet_DefaultSet1(void) // sport
469,7 → 471,7
Mixer.Motor[2][MIX_GAS] = 64; Mixer.Motor[2][MIX_NICK] = 0; Mixer.Motor[2][MIX_ROLL] = -64; Mixer.Motor[2][MIX_YAW] = -64;
Mixer.Motor[3][MIX_GAS] = 64; Mixer.Motor[3][MIX_NICK] = 0; Mixer.Motor[3][MIX_ROLL] = +64; Mixer.Motor[3][MIX_YAW] = -64;
memcpy(Mixer.Name, "Quadro\0", 7);
Mixer.crc = Mixer.crc = RAM_Checksum((uint8_t*)(&Mixer), sizeof(Mixer) - 1);
Mixer.crc = RAM_Checksum((uint8_t*)(&Mixer), sizeof(Mixer) - 1);
}
 
/***************************************************/
/trunk/eeprom.h
4,7 → 4,7
#include <inttypes.h>
#include "twimaster.h"
 
#define EEPARAM_REVISION 88 // is count up, if paramater stucture has changed (compatibility)
#define EEPARAM_REVISION 89 // is count up, if paramater stucture has changed (compatibility)
#define EEMIXER_REVISION 1 // is count up, if mixer stucture has changed (compatibility)
 
#define EEPROM_ADR_PARAM_BEGIN 0
40,6 → 40,11
extern MixerTable_t Mixer;
extern uint8_t RequiredMotors;
 
//GlobalConfig3
#define CFG3_NO_SDCARD_NO_START 0x01
#define CFG3_DPH_MAX_RADIUS 0x02
#define CFG3_VARIO_FAILSAFE 0x04
 
//GlobalConfig
#define CFG_HOEHENREGELUNG 0x01
#define CFG_HOEHEN_SCHALTER 0x02
218,10 → 223,12
unsigned char ComingHomeAltitude;
unsigned char FailSafeTime;
unsigned char MaxAltitude;
unsigned char FailsafeChannel; // if the value of this channel is > 100, the MK reports "RC-Lost"
//------------------------------------------------
unsigned char BitConfig; // (war Loop-Cfg) Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
unsigned char ServoCompInvert; // // 0x01 = Nick, 0x02 = Roll 0 oder 1 // WICHTIG!!! am Ende lassen
unsigned char ExtraConfig; // bitcodiert
unsigned char GlobalConfig3; // bitcodiert
char Name[12];
unsigned char crc; // must be the last byte!
} paramset_t;
/trunk/fc.c
693,9 → 693,13
FC_StatusFlags &= ~(FC_STATUS_EMERGENCY_LANDING | FC_STATUS_FLY);
}
ROT_ON;
if(modell_fliegt > 1000) // wahrscheinlich in der Luft --> langsam absenken
if(modell_fliegt > 1000 && Capacity.MinOfMaxPWM > 100) // wahrscheinlich in der Luft --> langsam absenken
{
GasMischanteil = EE_Parameter.NotGas;
if(EE_Parameter.GlobalConfig3 & CFG3_VARIO_FAILSAFE)
{
if(HoverGas && HoverGas < 150 * STICK_GAIN) GasMischanteil = HoverGas/(STICK_GAIN + STICK_GAIN/4); // 80% of Hovergas
}
FC_StatusFlags |= FC_STATUS_EMERGENCY_LANDING;
PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] = 0;
PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] = 0;
1817,6 → 1821,8
else if(Mixer.Motor[i][3] == -64) tmp_int -= GierMischanteil;
else tmp_int += ((long)GierMischanteil * Mixer.Motor[i][3]) / 64L;
 
//if(Parameter_UserParam7 < 128)
{
if(tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2; // MotorSmoothing
// else tmp_int = 2 * tmp_int - tmp_motorwert[i]; // original MotorSmoothing
else
1832,6 → 1838,7
tmp_int = tmp_int + ((tmp_motorwert[i] - tmp_int)/EE_Parameter.MotorSmooth);
}
}
}
 
LIMIT_MIN_MAX(tmp_int,(int) MIN_GAS * 4,(int) MAX_GAS * 4);
Motor[i].SetPoint = tmp_int / 4;
/trunk/hottmenu.c
61,7 → 61,9
"GPS Fix lost \0", // 21
"Magnet Error \0", // 22
"Motor restart \0", // 23
"BL Limitation \0" // 24
"BL Limitation \0", // 24
"GPS Range \0", // 25
"No SD-Card \0" // 26
};
 
unsigned char MaxBlTempertaure = 0;
97,6 → 99,7
{
if(FC_StatusFlags & FC_STATUS_LOWBAT) return(VOICE_MINIMALE_EINGANSSPANNUNG);
if(MotorenEin && NC_ErrorCode) return(VOICE_BEEP);
//if(Parameter_UserParam1) return(Parameter_UserParam1);
return(0);
}
 
/trunk/hottmenu.h
3,7 → 3,7
 
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
 
#define MAX_ERR_NUMBER (24+1)
#define MAX_ERR_NUMBER (26+1)
extern const char PROGMEM NC_ERROR_TEXT[MAX_ERR_NUMBER][17];
 
extern unsigned char HottKeyboard,HoTT_RequestedSensor;
/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/main.h
3,6 → 3,7
 
//#define DEBUG // use to activate debug output to MK-Tool: use Debug(text);
//#define ACT_S3D_SUMMENSIGNAL
//#define UserParameter8_FAILSAFE
//#define RECEIVER_SPEKTRUM_DX7EXP
//#define RECEIVER_SPEKTRUM_DX8EXP
 
/trunk/rc.c
20,8 → 20,7
unsigned int PPM_Neutral = 466;
 
//############################################################################
//zum decodieren des PPM-Signals wird Timer1 mit seiner Input
//Capture Funktion benutzt:
// Clear the values
void rc_sum_init (void)
//############################################################################
{
39,7 → 38,7
 
#ifndef ACT_S3D_SUMMENSIGNAL
//############################################################################
//Diese Routine startet und inizialisiert den Timer für RC
// Interrupt function for the PPM-Input
ISR(TIMER1_CAPT_vect)
//############################################################################
{
66,7 → 65,10
{
signal -= PPM_Neutral;
// Stabiles Signal
if(abs(signal - PPM_in[index]) < 6) { if(SenderOkay < 200) SenderOkay += 10; else SenderOkay = 200;}
if(EE_Parameter.FailsafeChannel == 0 || PPM_in[EE_Parameter.FailsafeChannel] < 100) // forces Failsafe if the receiver doesn't have 'signal loss' on Failsafe
{
if(abs(signal - PPM_in[index]) < 6) { if(SenderOkay < 200) SenderOkay += 10; else SenderOkay = 200;}
}
tmp = (3 * (PPM_in[index]) + signal) / 4;
if(tmp > signal+1) tmp--; else
if(tmp < signal-1) tmp++;
135,10 → 137,13
// Stabiles Signal
if((abs(signal - ppm_in[index]) < 6))
{
if(okay_cnt > 25) SenderOkay += 10;
else
if(okay_cnt > 10) SenderOkay += 2;
if(SenderOkay > 200) SenderOkay = 200;
if(EE_Parameter.FailsafeChannel == 0 || PPM_in[EE_Parameter.FailsafeChannel] < 100) // forces Failsafe if the receiver doesn't have 'signal loss' on Failsafe
{
if(okay_cnt > 25) SenderOkay += 10;
else
if(okay_cnt > 10) SenderOkay += 2;
if(SenderOkay > 200) SenderOkay = 200;
}
}
tmp = (3 * (ppm_in[index]) + signal) / 4;
if(tmp > signal+1) tmp--; else
175,7 → 180,7
 
#else
//############################################################################
//Diese Routine startet und inizialisiert den Timer für RC
// Interrupt function for the PPM-Input
ISR(TIMER1_CAPT_vect)
//############################################################################
 
/trunk/rc.h
5,11 → 5,6
#ifndef _RC_H
#define _RC_H
 
#if defined (__AVR_ATmega32__)
#define TIMER_TEILER CK64
#define TIMER_RELOAD_VALUE 250
#endif
 
#if defined (__AVR_ATmega644__)
#define TIMER_RELOAD_VALUE 250
#endif
/trunk/spi.c
10,8 → 10,8
struct str_SPI_VersionInfo NC_Version;
struct str_GPSInfo GPSInfo;
 
unsigned char SPI_BufferIndex;
unsigned char SPI_RxBufferIndex;
unsigned char SPI_BufferIndex;
unsigned char SPI_RxBufferIndex;
signed char FromNC_Rotate_C = 32, FromNC_Rotate_S = 0;
 
volatile unsigned char SPI_Buffer[sizeof(FromNaviCtrl)];
270,6 → 270,7
ToNaviCtrl.Param.Byte[8] = VersionInfo.HardwareError[3];
ToNaviCtrl.Param.Byte[9] = VersionInfo.HardwareError[4];
ToNaviCtrl.Param.Byte[10] = EE_Parameter.OrientationAngle;
ToNaviCtrl.Param.Byte[11] = EE_Parameter.GlobalConfig3;
break;
case SPI_FCCMD_SERVOS:
ToNaviCtrl.Param.Byte[0] = EE_Parameter.ServoNickRefresh; // Parameters for the Servo Control
/trunk/uart.c
31,20 → 31,6
#define MASK_SET_DEFAULT_PARAMS 0x40
#define MASK_SET_SAVE_EEPROM 0x80
 
typedef struct
{
unsigned char Revision; // revision of parameter structure
unsigned char Address; // target address
unsigned char PwmScaling; // maximum value of pwm setpoint
unsigned char CurrentLimit; // current limit in 1A steps
unsigned char TemperatureLimit; // in °C
unsigned char CurrentScaling; // scaling factor for current measurement
unsigned char BitConfig; // see defines above
unsigned char SetMask; // filter for active paramters
unsigned char Checksum; // checksum for parameter sturcture
} __attribute__((packed)) BLParameter_t;
 
 
unsigned char GetExternalControl = 0,DebugDisplayAnforderung1 = 0, DebugDisplayAnforderung = 0,DebugDataAnforderung = 0,GetVersionAnforderung = 0, GetPPMChannelAnforderung = 0;
unsigned char DisplayLine = 0;
unsigned volatile char SioTmp = 0;
/trunk/uart.h
19,7 → 19,7
extern int Debug_Timer,Kompass_Timer;
extern void UART_Init (void);
extern void uart_putchar (char c);
extern void boot_program_page (uint32_t page, uint8_t *buf);
//extern void boot_program_page (uint32_t page, uint8_t *buf);
extern void DatenUebertragung(void);
extern void Uart1Init(void);
extern void BearbeiteRxDaten(void);
/trunk/version.txt
523,7 → 523,12
0.86d H.Buss 26.09.2011
- Analog.c: Vario Überlauf anders verhinden
- Poti1-6 auch im HoTT-Display
 
0.87a
- Failsafe-Kanal
- Failsafe: x Sekunden warten & y Sekunden nur Höhe ändern
- Option: Failsafe-Sinkflug 80% Schwebegas
- Stopp der Motoren wenn bei Failsafe ein Motor blockiert
- 60 Sekunden Failsafe-Zeit