/beta/Code Redesign killagreg/dsl.c |
---|
89,6 → 89,7 |
#include <stdlib.h> |
#include "dsl.h" |
#include "rc.h" |
#include "eeprom.h" |
uint8_t dsl_RSSI = 0; |
uint8_t dsl_Battery = 0; |
167,6 → 168,16 |
dsl_Battery = PacketBuffer[4]; // Get voltage of battery supply |
// ?? = PacketBuffer[5]; |
RC_RSSI = dsl_RSSI; |
PPM_in[0] = RC_RSSI; |
if(RC_RSSI == 0) |
{ // set to neutral attitude commands |
PPM_diff[ParamSet.ChannelAssignment[CH_NICK]] = 0; |
PPM_diff[ParamSet.ChannelAssignment[CH_ROLL]] = 0; |
PPM_diff[ParamSet.ChannelAssignment[CH_YAW]] = 0; |
PPM_in[ParamSet.ChannelAssignment[CH_NICK]] = 0; |
PPM_in[ParamSet.ChannelAssignment[CH_ROLL]] = 0; |
PPM_in[ParamSet.ChannelAssignment[CH_YAW]] = 0; |
} |
} |
else // probably a channel pair |
{ |
/beta/Code Redesign killagreg/fc.c |
---|
1588,6 → 1588,7 |
static uint8_t HeightTrimmingFlag = 0x00; |
HooverGas = (int16_t)(HooverGasEstimation/HOOVER_GAS_AVERAGE); |
#define HEIGHT_CONTROL_STICKTHRESHOLD 15 * STICK_GAIN |
if(MKFlags & MKFLAG_FLY) // trim setpoint only when flying |
1639,7 → 1640,7 |
// and the hover height will be allways larger than height setpoint. |
if((ReadingHeight > SetPointHeight) && HeightControlActive && !(MKFlags & MKFLAG_EMERGENCY_LANDING)) |
{ |
HeightControlGas = GasMixFraction; // take stick gas |
HeightControlGas = GasMixFraction; // take stick gas, |
#endif // from this point the Heigth Control is identical |
HeightControlGas -= ((int16_t)(ReadingHeight - SetPointHeight) * (int16_t)FCParam.HeightP) / 16; // p-part |
// quadratic scaling to ReadingVario in the D-Part |
1676,7 → 1677,7 |
if((MKFlags & MKFLAG_FLY) && !(MKFlags & MKFLAG_EMERGENCY_LANDING)) |
{ |
if(HooverGasEstimation == 0) HooverGasEstimation = HOOVER_GAS_AVERAGE * (uint32_t)GasMixFraction; // init estimation |
if(abs(ReadingVario) < 400) |
if(abs(ReadingVario) < 150) |
{ |
tmp_long3 = (int32_t)GasMixFraction; // take current thrust |
tmp_long3 *= CosNick; // apply nick projection |
1688,6 → 1689,7 |
HooverGasEstimation += tmp_long3; |
} |
} |
DebugOut.Analog[25] = (int16_t)(HooverGasEstimation/HOOVER_GAS_AVERAGE); |
}// EOF ParamSet.GlobalConfig & CFG_HEIGHT_CONTROL |
// limit gas to parameter setting |
/beta/Code Redesign killagreg/main.c |
---|
127,6 → 127,7 |
void LipoDetection(uint8_t print) |
{ |
#define MIN_VOLTAGE_WARNING 93 // minimum low voltage warning to protect LiPO |
uint16_t timer; |
if(print) printf("\n\rBatt:"); |
if(ParamSet.LowVoltageWarning < 50) // below 5.0 V the value is interpreted as single cell low volatage warning |
156,6 → 157,7 |
{ |
LowVoltageWarning = ParamSet.LowVoltageWarning; |
} |
if(LowVoltageWarning < MIN_VOLTAGE_WARNING) LowVoltageWarning = MIN_VOLTAGE_WARNING; |
if(print) printf("Low Warning level: %d.%dV", LowVoltageWarning/10, LowVoltageWarning%10); |
} |
/beta/Code Redesign killagreg/makefile |
---|
5,7 → 5,7 |
#------------------------------------------------------------------- |
VERSION_MAJOR = 0 |
VERSION_MINOR = 75 |
VERSION_PATCH = 5 |
VERSION_PATCH = 7 |
VERSION_SERIAL_MAJOR = 10 # Serial Protocol Major Version |
VERSION_SERIAL_MINOR = 1 # Serial Protocol Minor Version |
/beta/Code Redesign killagreg/menu.c |
---|
220,9 → 220,10 |
LCD_printfxy(0,3,"Height %4i (%3i)",AdValueAccTop, (int16_t)AdBiasAccTop); |
break; |
case 7:// Accumulator Voltage / Remote Control Level |
LCD_printfxy(0,1,"Voltage: %3i.%1iV",UBat/10, UBat%10); |
LCD_printfxy(0,2,"RC-Level: %5i",RC_Quality); |
LCD_printfxy(0,3,"Channels: %4i", RC_Channels); |
LCD_printfxy(0,0,"Voltage: %3i.%1iV",UBat/10, UBat%10); |
LCD_printfxy(0,1,"RC-Level: %4i", RC_Quality); |
LCD_printfxy(0,2,"RC-Channels:%4i", RC_Channels); |
LCD_printfxy(0,3,"RC-RSSI: %4i", RC_RSSI); |
break; |
case 8:// Compass Menu Item |
LCD_printfxy(0,0,"Compass "); |
/beta/Code Redesign killagreg/rc.c |
---|
185,8 → 185,12 |
} |
if(okay_cnt < 255) okay_cnt++; |
} // eof if(index >= 4 && index == RC_Channels) |
else if(okay_cnt > 100) okay_cnt = 10; |
else okay_cnt = 0; |
else |
{ |
if(okay_cnt > 100) okay_cnt = 10; |
else okay_cnt = 0; |
RED_ON; |
} |
// store max channels transmitted |
if(!(MKFlags & MKFLAG_MOTOR_RUN)) RC_Channels = index; |
// reset channel index |
245,8 → 249,6 |
} |
} // eof (index >= MAX_CHANNELS) |
} // eof within the PPM frame |
DebugOut.Analog[16] = okay_cnt; |
DebugOut.Analog[17] = PPM_in[2]; |
} |
/beta/Code Redesign killagreg/uart0.c |
---|
145,17 → 145,17 |
"Motor Right ", //15 |
" ", |
" ", |
"Vario ", |
"CompassCalState ", |
"VarioMeter ", |
"MK3MAG CalState ", |
"NickServo ", //20 |
"RollServo ", |
"AirPress ", |
"RCFrameOKCount ", |
" ", |
" ", //25 |
" ", |
" ", |
"Hoovergas ", //25 |
"MaxHoover ", |
"Kalman Max Drift", |
" ", |
"MinHoover ", |
"Navi Serial Data", |
"GPS Nick ", //30 |
"GPS Roll " |
/beta/Code Redesign killagreg/version.txt |
---|
294,9 → 294,15 |
- Lagewinkel wirkt jetzt mit 1/Cos(x) mit in den Höhenregler |
- leichte Modifikation der RC-Empfangroutine |
Anpassungen bzgl. V0.75f |
G.Stobrawa 27.8.2009: |
0.75g H.Buss 31.08.2009 |
- die Akkuspannung geht jetzt antiproportional ins Gas ein |
0.75h H.Buss 3.09.2009 |
- im Höhenregler werden jetzt die Stellwerte begrenzt --> max +- 16% vom geschätzten Schwebegas |
Anpassungen bzgl. V0.75h |
G.Stobrawa 3.9.2009: |
- Code stärker modularisiert und restrukturiert |
- viele Kommentare zur Erklärug eingefügt |
- konsequent englische Variablennamen |