Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 1692 → Rev 1693

/trunk/fc.c
1481,7 → 1481,7
LIMIT_MIN_MAX(tmp_long, -32767L, 32767L); // avoid overflov when casting to int16_t
HeightDeviation = (int)(tmp_long); // positive when too high
tmp_long = (tmp_long * (long)Parameter_Hoehe_P) / 16L; // p-part
LIMIT_MIN_MAX(tmp_long, -255 * STICK_GAIN, 255 * STICK_GAIN); // more than 2 times the full range makes no sense
LIMIT_MIN_MAX(tmp_long, -127 * STICK_GAIN, 255 * STICK_GAIN); // more than the full range makes no sense
HCGas -= tmp_long;
// ------------------------- D-Part 1: Vario Meter ----------------------------
tmp_int = VarioMeter / 8;
1502,11 → 1502,10
tmp_int = (Parameter_Hoehe_GPS_Z * (int)FromNaviCtrl_Value.GpsZ)/128L;
LIMIT_MIN_MAX(tmp_int, -32 * STICK_GAIN, 64 * STICK_GAIN);
HCGas -= tmp_int;
 
// limit deviation from hoover point within the target region
if(!HeightTrimming && HoverGas > 0) // height setpoint is not changed and hoover gas not zero
{
unsigned int tmp,min,max;
signed int tmp,min,max;
if(abs(HeightDeviation) < 60)
{
LIMIT_MIN_MAX(HCGas, HoverGasMin, HoverGasMax); // limit gas around the hoover point
1515,12 → 1514,16
{
tmp = (abs(HeightDeviation) - 60)/32;
if(tmp > 15) tmp = 15;
max = (HoverGasMax * (tmp + 16)) / 16;
min = (HoverGasMin * (16 - tmp)) / 16;
LIMIT_MIN_MAX(HCGas, min, max); // limit gas around the hoover point
DebugOut.Analog[16] = min;
DebugOut.Analog[17] = max;
DebugOut.Analog[18] = SollHoehe;
if(HeightDeviation > 0)
{
min = (HoverGasMin * (16 - tmp)) / 16;
LIMIT_MIN_MAX(HCGas, min, HoverGasMax); // limit gas around the hoover point
}
else
{
max = (HoverGasMax * (tmp + 16)) / 16;
LIMIT_MIN_MAX(HCGas, HoverGasMin, max); // limit gas around the hoover point
}
}
}
// strech control output by inverse attitude projection 1/cos
1647,12 → 1650,7
else SummeNick += DiffNick; // I-Anteil bei HH
if(SummeNick > (STICK_GAIN * 16000L)) SummeNick = (STICK_GAIN * 16000L);
if(SummeNick < -(16000L * STICK_GAIN)) SummeNick = -(16000L * STICK_GAIN);
 
//if(Parameter_UserParam5 > 50)
pd_ergebnis_nick = (EE_Parameter.Gyro_Stability * DiffNick) / 8 + SummeNick / Ki; // PI-Regler für Nick
//else
// pd_ergebnis_nick = DiffNick + SummeNick / Ki; // PI-Regler für Nick
 
// Motor Vorn
tmp_int = (long)((long)Parameter_DynamicStability * (long)(GasMischanteil + abs(GierMischanteil)/2)) / 64;
if(pd_ergebnis_nick > tmp_int) pd_ergebnis_nick = tmp_int;
1666,12 → 1664,7
else SummeRoll += DiffRoll; // I-Anteil bei HH
if(SummeRoll > (STICK_GAIN * 16000L)) SummeRoll = (STICK_GAIN * 16000L);
if(SummeRoll < -(16000L * STICK_GAIN)) SummeRoll = -(16000L * STICK_GAIN);
 
//if(Parameter_UserParam5 > 50)
pd_ergebnis_roll = (EE_Parameter.Gyro_Stability * DiffRoll) / 8 + SummeRoll / Ki; // PI-Regler für Roll
//else
// pd_ergebnis_roll = DiffRoll + SummeRoll / Ki; // PI-Regler für Roll
 
tmp_int = (long)((long)Parameter_DynamicStability * (long)(GasMischanteil + abs(GierMischanteil)/2)) / 64;
if(pd_ergebnis_roll > tmp_int) pd_ergebnis_roll = tmp_int;
if(pd_ergebnis_roll < -tmp_int) pd_ergebnis_roll = -tmp_int;
1704,15 → 1697,7
if(tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2; // MotorSmoothing
else tmp_int = 2 * tmp_int - tmp_motorwert[i]; // MotorSmoothing
}
/*
if(Parameter_UserParam5 > 50)
{
if(tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2; // MotorSmoothing
// else tmp_int = 2 * tmp_int - tmp_motorwert[i]; // MotorSmoothing
else tmp_int -= Parameter_UserParam6 * (tmp_motorwert[i] - tmp_int); // MotorSmoothing
}
*/
 
LIMIT_MIN_MAX(tmp_int,MIN_GAS * 4,MAX_GAS * 4);
Motor[i].SetPoint = tmp_int / 4;
Motor[i].SetPointLowerBits = (tmp_int % 4)<<1; // (3 bits total)
/trunk/jetimenu.c
37,17 → 37,15
}
}
 
void Menu_Attitude(uint8_t key)
void Menu_Temperature(uint8_t key)
{ //0123456789ABCDEF
// JetiBox_printfxy(0,0,"Nick Roll Yaw");
JetiBox_printfxy(0,1,"%4i %4i %4i", (int16_t)(IntegralNick/1024), (int16_t)(IntegralRoll/1024), (int16_t)(ErsatzKompass / GIER_GRAD_FAKTOR));
JetiBox_printfxy(0,0,"%3i %3i %3i %3i", Motor[0].Temperature, Motor[1].Temperature, Motor[2].Temperature, Motor[3].Temperature);
// JetiBox_printfxy(0,1,"%3i %3i %3i %3i", Motor[4].Temperature, Motor[5].Temperature, Motor[6].Temperature, Motor[7].Temperature);
JetiBox_printfxy(0,1,"%3i %3i %3i %3i", Motor[4].Temperature, Motor[5].Temperature, Motor[6].Temperature, Motor[7].Temperature);
if(RequiredMotors <= 4)
{
JetiBox_printfxy(0,1,"Temperatures ");
//JetiBox_printfxy(0,0,"%3i ", Poti3);
//JetiBox_printfxy(0,1,"%3i %3i %3i %i ",HoverGas,DebugOut.Analog[16],DebugOut.Analog[17],DebugOut.Analog[18]);
//JetiBox_printfxy(0,1,"%3i %3i %3i %i ",HoverGas,DebugOut.Analog[26],DebugOut.Analog[17],DebugOut.Analog[18]);
}
else
if(RequiredMotors <= 6)
118,7 → 116,7
const MENU_ENTRY JetiBox_Menu[] PROGMEM=
{ // l r u d pHandler
{3, 1, 0, 0, &Menu_Status }, // 0
{0, 2, 1, 1, &Menu_Attitude }, // 1
{0, 2, 1, 1, &Menu_Temperature }, // 1
{1, 3, 2, 2, &Menu_Battery }, // 2
{2, 0, 3, 3, &Menu_PosInfo }, // 3
};
/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/makefile
6,7 → 6,7
#-------------------------------------------------------------------
VERSION_MAJOR = 0
VERSION_MINOR = 79
VERSION_PATCH = 15
VERSION_PATCH = 16
VERSION_SERIAL_MAJOR = 11 # Serial Protocol
VERSION_SERIAL_MINOR = 0 # Serial Protocol
NC_SPI_COMPATIBLE = 13 # Navi-Kompatibilität
/trunk/uart.c
98,18 → 98,18
"Motor 2 ",
"Motor 3 ",
"Motor 4 ", //15
" ",
" ",
" ",
" ",
"P ",
"D ",
"ACC ",
"GPS ",
"Servo ", //20
"Hovergas ",
"Current [0.1A] ",
"Capacity [mAh] ",
" ",
" ", //25
" ",
" ",
" 24 ",
" 25 ", //25
" 26 ",
" 27 ",
"I2C-Error ",
"BL Limit ",
"GPS_Nick ", //30
/trunk/version.txt
429,5 → 429,6
- nur wenn Motoren laufen: Beepen, wenn Carefree ohne Navi oder ohne gültigen MK3Mag-Wert
- nur wenn Motoren laufen: Beepen wenn NC plötzlich ausfällt
 
0.79p
0.79p + q
- Höhenregler