/trunk/eeprom.c |
---|
155,6 → 155,7 |
EE_Parameter.HoeheChannel = 5; // Wert : 0-32 |
EE_Parameter.Hoehe_MinGas = 30; |
EE_Parameter.Hoehe_TiltCompensation = 100; // in % |
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
if(ACC_AltitudeControl) |
163,9 → 164,8 |
EE_Parameter.Luftdruck_D = 40; // Wert : 0-247 |
EE_Parameter.Hoehe_ACC_Wirkung = 30; // Wert : 0-247 |
EE_Parameter.Hoehe_HoverBand = 1; // Wert : 0-247 |
EE_Parameter.Hoehe_GPS_Z = 0; // Wert : 0-247 |
EE_Parameter.Hoehe_StickNeutralPoint = 127;// Wert : 0-247 (0 = Hover-Estimation) |
EE_Parameter.FailSafeTime = 30; // 0 = off |
EE_Parameter.FailSafeTime = 60; // 0 = off |
} |
else |
#endif |
174,7 → 174,6 |
EE_Parameter.Luftdruck_D = 30; // Wert : 0-247 |
EE_Parameter.Hoehe_ACC_Wirkung = 0; // Wert : 0-247 |
EE_Parameter.Hoehe_HoverBand = 8; // Wert : 0-247 |
EE_Parameter.Hoehe_GPS_Z = 20; // Wert : 0-247 |
EE_Parameter.Hoehe_StickNeutralPoint = 0;// Wert : 0-247 (0 = Hover-Estimation) |
EE_Parameter.FailSafeTime = 0; // 0 = off |
} |
/trunk/eeprom.h |
---|
4,7 → 4,7 |
#include <inttypes.h> |
#include "twimaster.h" |
#define EEPARAM_REVISION 102 // is count up, if paramater stucture has changed (compatibility) |
#define EEPARAM_REVISION 103 // 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 |
154,7 → 154,7 |
unsigned char Hoehe_Verstaerkung; // Wert : 0-50 |
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250 |
unsigned char Hoehe_HoverBand; // Wert : 0-250 |
unsigned char Hoehe_GPS_Z; // Wert : 0-250 |
unsigned char Hoehe_TiltCompensation; // Wert : 0-250 |
unsigned char Hoehe_StickNeutralPoint;// Wert : 0-250 |
unsigned char Stick_P; // Wert : 1-6 |
unsigned char Stick_D; // Wert : 0-64 |
/trunk/fc.c |
---|
122,7 → 122,7 |
unsigned char Parameter_Hoehe_P = 16; // Wert : 0-32 |
unsigned char Parameter_Hoehe_ACC_Wirkung = 58; // Wert : 0-250 |
unsigned char Parameter_KompassWirkung = 64; // Wert : 0-250 |
unsigned char Parameter_Hoehe_GPS_Z = 64; // Wert : 0-250 |
unsigned char Parameter_Hoehe_TiltCompensation = 100; // Wert : 0-250 |
unsigned char Parameter_Gyro_D = 8; // Wert : 0-250 |
unsigned char Parameter_Gyro_P = 150; // Wert : 10-250 |
unsigned char Parameter_Gyro_I = 150; // Wert : 0-250 |
696,7 → 696,6 |
CHK_POTI_MM(Parameter_Gyro_P,EE_Parameter.Gyro_P,10,255); |
CHK_POTI_MM(Parameter_J16Timing,EE_Parameter.J16Timing,5,255); |
CHK_POTI_MM(Parameter_J17Timing,EE_Parameter.J17Timing,5,255); |
if(EE_Parameter.Servo3 == 247) { if(PORTC & (1<<PORTC2)) Parameter_Servo3 = EE_Parameter.Servo3OnValue; else Parameter_Servo3 = EE_Parameter.Servo3OffValue;} // Out1 (J16) |
else if(EE_Parameter.Servo3 == 246) { if(PORTC & (1<<PORTC3)) Parameter_Servo3 = EE_Parameter.Servo3OnValue; else Parameter_Servo3 = EE_Parameter.Servo3OffValue;} |
else CHK_POTI_MM(Parameter_Servo3,EE_Parameter.Servo3, 24, 255); |
708,7 → 707,7 |
CHK_POTI_MM(Parameter_Servo5,EE_Parameter.Servo5, 24, 255); |
Parameter_HoehenSchalter = GetChannelValue(EE_Parameter.HoeheChannel); |
CHK_POTI(Parameter_Hoehe_ACC_Wirkung,EE_Parameter.Hoehe_ACC_Wirkung); |
CHK_POTI(Parameter_Hoehe_GPS_Z,EE_Parameter.Hoehe_GPS_Z); |
CHK_POTI(Parameter_Hoehe_TiltCompensation,EE_Parameter.Hoehe_TiltCompensation); |
CHK_POTI(Parameter_KompassWirkung,EE_Parameter.KompassWirkung); |
CHK_POTI(Parameter_Gyro_I,EE_Parameter.Gyro_I); |
CHK_POTI(Parameter_Gyro_D,EE_Parameter.Gyro_D); |
844,11 → 843,6 |
{ |
GasMischanteil = HooverGasEmergencyPercent; |
FC_StatusFlags |= FC_STATUS_EMERGENCY_LANDING; |
PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] = 0; |
} |
else |
{ |
1814,9 → 1808,10 |
// calculate cos of nick and roll angle used for projection of the vertical hoover gas |
tmp_int = (int)(IntegralNick/GIER_GRAD_FAKTOR); // nick angle in deg |
tmp_int2 = (int)(IntegralRoll/GIER_GRAD_FAKTOR); // roll angle in deg |
CosAttitude = (int16_t)ihypot(tmp_int, tmp_int2); // phytagoras gives effective attitude angle in deg |
LIMIT_MAX(CosAttitude, 60); // limit effective attitude angle |
CosAttitude = c_cos_8192(CosAttitude); // cos of actual attitude |
tmp_int = (int16_t)ihypot(tmp_int, tmp_int2); // phytagoras gives effective attitude angle in deg |
tmp_int = (tmp_int * Parameter_Hoehe_TiltCompensation) / 100; |
LIMIT_MAX(tmp_int, 60); // limit effective attitude angle |
CosAttitude = c_cos_8192(tmp_int); // cos of actual attitude |
VarioCharacter = ' '; |
AltitudeSetpointTrimming = 0; |
if(HoehenReglerAktiv && !(FC_StatusFlags & FC_STATUS_EMERGENCY_LANDING)) |
1941,7 → 1936,7 |
} |
HeightTrimming = 0; |
LIMIT_MIN_MAX(HoehenWertF, (HoehenWert-1024), (HoehenWert+1024)); // max. 10m Unterschied |
LIMIT_MIN_MAX(SollHoehe, (HoehenWertF-1024), (HoehenWertF+1024)); // max. 10m Unterschied |
LIMIT_MIN_MAX(SollHoehe, (HoehenWertF-1024), (HoehenWertF+1500)); // max. 15m Unterschied |
if(Parameter_ExtraConfig & CFG2_VARIO_BEEP) beeptime = 100; |
//update hoover gas stick value when setpoint is shifted |
if(FromNC_AltitudeSpeed == 0) CalcStickGasHover(); |
2007,10 → 2002,11 |
LIMIT_MIN_MAX(tmp_long, -32 * STICK_GAIN, 64 * STICK_GAIN); |
GasReduction += tmp_long; |
} |
// ------------------------ D-Part 3: GpsZ ---------------------------------- |
/* // ------------------------ D-Part 3: GpsZ ---------------------------------- |
tmp_int = (Parameter_Hoehe_GPS_Z * (int)FromNaviCtrl_Value.GpsZ)/128L; |
LIMIT_MIN_MAX(tmp_int, -32 * STICK_GAIN, 64 * STICK_GAIN); |
GasReduction += tmp_int; |
*/ |
GasReduction = (long)((long)GasReduction * HoverGas) / 512; // scale to the gas value |
// ------------------------ ---------------------------------- |
/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.c |
---|
343,6 → 343,13 |
TIMSK1 |= _BV(ICIE1); // enable PPM-Input |
PPM_in[0] = 0; // set RSSI to zero on data timeout |
VersionInfo.HardwareError[1] |= FC_ERROR1_PPM; |
// Now clear the channel values - they would be wrong |
PPM_diff[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
PPM_diff[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] = 0; |
PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] = 0; |
} |
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
//if(HoehenReglerAktiv && NaviDataOkay && SenderOkay < 160 && SenderOkay > 10 && FromNaviCtrl_Value.SerialDataOkay > 220) SenderOkay = 160; |
/trunk/makefile |
---|
6,11 → 6,11 |
#------------------------------------------------------------------- |
VERSION_MAJOR = 2 |
VERSION_MINOR = 07 |
VERSION_PATCH = 0 |
VERSION_PATCH = 3 |
VERSION_SERIAL_MAJOR = 11 # Serial Protocol to KopterTool -> do not change! |
VERSION_SERIAL_MINOR = 0 # Serial Protocol |
NC_SPI_COMPATIBLE = 71 # Navi-Kompatibilität |
LIB_FC_COMPATIBLE = 6 # Library |
LIB_FC_COMPATIBLE = 7 # Library |
#------------------------------------------------------------------- |
# ATMEGA644: 63487 is maximum |
#------------------------------------------------------------------- |
/trunk/mymath.c |
---|
7,11 → 7,11 |
// Sinus with argument in degree at an angular resolution of 1 degree and a discretisation of 13 bit. |
const uint16_t pgm_sinlookup[91] PROGMEM = {0, 143, 286, 429, 571, 714, 856, 998, 1140, 1282, 1423, 1563, 1703, 1843, 1982, 2120, 2258, 2395, 2531, 2667, 2802, 2936, 3069, 3201, 3332, 3462, 3591, 3719, 3846, 3972, 4096, 4219, 4341, 4462, 4581, 4699, 4815, 4930, 5043, 5155, 5266, 5374, 5482, 5587, 5691, 5793, 5893, 5991, 6088, 6183, 6275, 6366, 6455, 6542, 6627, 6710, 6791, 6870, 6947, 7022, 7094, 7165, 7233, 7299, 7363, 7424, 7484, 7541, 7595, 7648, 7698, 7746, 7791, 7834, 7875, 7913, 7949, 7982, 8013, 8041, 8068, 8091, 8112, 8131, 8147, 8161, 8172, 8181, 8187, 8191, 8192}; |
int16_t c_sin_8192(int16_t angle) |
int16_t c_cos_8192(int16_t angle) |
{ |
int8_t m,n; |
int16_t sinus; |
angle = 90 - angle; // we need the cosinus and not the sinus |
// avoid negative angles |
if (angle < 0) |
{ |
33,9 → 33,10 |
// calculate sinus value |
return (sinus * m * n); |
} |
/* |
// Cosinus with argument in degree at an angular resolution of 1 degree and a discretisation of 13 bit. |
int16_t c_cos_8192(int16_t angle) |
{ |
return (c_sin_8192(90 - angle)); |
} |
*/ |
/trunk/mymath.h |
---|
3,7 → 3,7 |
#include <inttypes.h> |
extern int16_t c_sin_8192(int16_t angle); |
//extern int16_t c_sin_8192(int16_t angle); |
extern int16_t c_cos_8192(int16_t angle); |
extern int16_t c_atan2(int16_t y, int16_t x); |
extern uint32_t c_sqrt(uint32_t a); |
/trunk/rc.c |
---|
122,9 → 122,19 |
tmp = (3 * (PPM_in[index]) + signal) / 4; |
if(tmp > signal+1) tmp--; else |
if(tmp < signal-1) tmp++; |
PPM_in[index] = tmp; |
if(SenderOkay >= 195) PPM_diff[index] = ((tmp - PPM_in[index]) / 3) * 3; |
else PPM_diff[index] = 0; |
PPM_in[index] = tmp; |
else |
{ |
PPM_diff[index] = 0; |
if(SenderOkay < 50) |
{ |
PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] = 0; |
PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]] = 0; |
PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] = 0; |
PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] = 0; |
} |
} |
} |
index++; |
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
/trunk/version.txt |
---|
740,6 → 740,16 |
2.07b (03.09.2014) |
- camera releases via automatic distances faster than 1 sec |
2.07c (23.09.2014) |
- clamp Altitude setpoint at +15m instead of +10m to allow faster starting |
2.07d (25.09.2014) |
- set all channels to zero in case of RC-Lost |
- removed: GPS_Z |
- New Parameter: Parameter_Hoehe_TiltCompensation |
- Default Failsafe-Time is 60sec (was 30sek before) |
toDo: |
- CalAthmospheare nachführen |
- ExpandBaro kürzer? |