/beta/Code Redesign killagreg/eeprom.c |
---|
144,7 → 144,7 |
ParamSet.Config0 = CFG0_AXIS_COUPLING_ACTIVE | CFG0_COMPASS_ACTIVE | CFG0_GPS_ACTIVE | CFG0_HEIGHT_SWITCH;//CFG0_HEIGHT_CONTROL | CFG0_COMPASS_FIX; |
ParamSet.Config1 = 0; |
ParamSet.Config2 = CFG2_HEIGHT_LIMIT | CFG2_VARIO_BEEP;//|CFG2_SENSITIVE_RC; |
ParamSet.Config2 = /*CFG2_HEIGHT_LIMIT |*/ CFG2_VARIO_BEEP;//|CFG2_SENSITIVE_RC; |
ParamSet.HeightMinGas = 30; |
ParamSet.MaxHeight = 255; |
ParamSet.HeightP = 15; |
170,16 → 170,16 |
ParamSet.UserParam7 = 0; |
ParamSet.UserParam8 = 0; |
ParamSet.ServoCompInvert = 2; |
ParamSet.ServoRefresh = 5; |
ParamSet.ServoNickControl = 120; |
ParamSet.ServoNickComp = 40; |
ParamSet.ServoRefresh = 4; |
ParamSet.ServoNickControl = 128; |
ParamSet.ServoNickComp = 50; |
ParamSet.ServoNickMin = 15; |
ParamSet.ServoNickMax = 247; |
ParamSet.ServoRollControl = 120; |
ParamSet.ServoRollComp = 90; |
ParamSet.ServoRollMin = 0; |
ParamSet.ServoRollMax = 247; |
ParamSet.ServoManualControlSpeed = 40; |
ParamSet.ServoNickMax = 230; |
ParamSet.ServoRollControl = 128; |
ParamSet.ServoRollComp = 85; |
ParamSet.ServoRollMin = 70; |
ParamSet.ServoRollMax = 220; |
ParamSet.ServoManualControlSpeed = 60; |
ParamSet.CamOrientation = 0; |
ParamSet.Servo3 = 125; |
ParamSet.Servo4 = 125; |
206,7 → 206,7 |
ParamSet.NaviStickThreshold = 8; |
ParamSet.NaviWindCorrection = 90; |
ParamSet.NaviSpeedCompensation = 30; |
ParamSet.NaviOperatingRadius = 100; |
ParamSet.NaviOperatingRadius = 245; |
ParamSet.NaviAngleLimitation = 100; |
ParamSet.NaviPHLoginTime = 2; |
ParamSet.ExternalControl = 0; |
/beta/Code Redesign killagreg/fc.c |
---|
118,8 → 118,8 |
volatile int32_t ReadingIntegralTop = 0; |
// compass course |
int16_t CompassHeading = -1; // negative angle indicates invalid data. |
int16_t CompassCourse = -1; |
int16_t CompassHeading = -1; // negative angle indicates invalid data. |
int16_t CompassCourse = -1; // compass sourse setpoint |
int16_t CompassOffCourse = 0; |
uint8_t CompassCalState = 0; |
int8_t CalculateCompassTimer = 100; |
205,11 → 205,14 |
DebugOut.Analog[13] = Motor[1].SetPoint; |
DebugOut.Analog[14] = Motor[2].SetPoint; |
DebugOut.Analog[15] = Motor[3].SetPoint; |
DebugOut.Analog[16] = NCAltitudeSpeed; |
DebugOut.Analog[17] = NCSetPointHeight; |
//DebugOut.Analog[18] = ReadingVario; |
//DebugOut.Analog[19] = CompassCalState; |
DebugOut.Analog[20] = ServoNickValue; |
DebugOut.Analog[22] = Capacity.ActualCurrent; |
DebugOut.Analog[23] = Capacity.UsedCapacity; |
DebugOut.Analog[24] = SetPointHeight/5; |
DebugOut.Analog[27] = CompassCourse; |
DebugOut.Analog[29] = Capacity.MinOfMaxPWM; |
DebugOut.Analog[30] = GPSStickNick; |
825,7 → 828,6 |
IPartRoll = 0; |
StickYaw = 0; |
ReadingIntegralGyroYaw = 0; |
SetPointYaw = 0; |
} |
else FC_StatusFlags |= FC_STATUS_FLY; // set fly flag |
1509,9 → 1511,10 |
// yawing MK |
if(!UpdateCompassCourse) |
{ |
r = ((540 + (YawGyroHeading / GYRO_DEG_FACTOR) - CompassCourse) % 360) - 180; |
r = ((540 + CompassCourse - (YawGyroHeading / GYRO_DEG_FACTOR)) % 360) - 180; |
DebugOut.Analog[19] = r; |
v = r * (FCParam.CompassYawEffect/2); |
if(abs(r) > 20) v *= 2; // over 20° course deviation -> twice as fast |
CompassYawSetPoint = v / 16; |
} |
else CompassYawSetPoint = 0; |
1621,6 → 1624,7 |
static int16_t FilterHCGas = 0; |
static int16_t HeightTrimming = 0; // rate for change of height setpoint |
static int8_t WaypointTrimming = 0; |
static uint8_t HCActive = 0; |
// the states for the hover gas filter |
#define HOVER_GAS_STATE_NONE 0 |
1772,11 → 1776,27 |
} |
else // gas stick in hover range |
{ |
if(FC_StatusFlags & (FC_STATUS_VARIO_TRIM_UP|FC_STATUS_VARIO_TRIM_DOWN)) |
VarioCharacter = '='; |
if(NCAltitudeSpeed && (NCSetPointHeight > SetPointHeight)) |
{ |
FC_StatusFlags |= FC_STATUS_VARIO_TRIM_UP; |
HeightTrimming += NCAltitudeSpeed; |
WaypointTrimming = 10; |
VarioCharacter = '^'; |
} |
else if(NCAltitudeSpeed && (NCSetPointHeight < SetPointHeight)) |
{ |
FC_StatusFlags |= FC_STATUS_VARIO_TRIM_DOWN; |
HeightTrimming -= NCAltitudeSpeed; |
WaypointTrimming = -10; |
VarioCharacter = 'v'; |
} |
else if(FC_StatusFlags & (FC_STATUS_VARIO_TRIM_UP|FC_STATUS_VARIO_TRIM_DOWN)) |
{ |
FC_StatusFlags &= ~(FC_STATUS_VARIO_TRIM_UP|FC_STATUS_VARIO_TRIM_DOWN); |
HeightTrimming = 0; |
SetPointHeight = ReadingHeight; // update setpoint to current height |
if(!WaypointTrimming) SetPointHeight = ReadingHeight; // update setpoint to current height |
else WaypointTrimming = 0; |
if(ParamSet.Config2 & CFG2_VARIO_BEEP) BeepTime = 500; |
if((HoverGasState == HOVER_GAS_STATE_NONE) && (ReadingHeight > 50) ) |
{ |
1783,17 → 1803,24 |
HoverGasState = HOVER_GAS_STATE_START; // initiate long term filter |
} |
} |
VarioCharacter = '='; |
} |
// trim height set point if needed |
if(abs(HeightTrimming) > 512) |
{ |
SetPointHeight += (HeightTrimming * ParamSet.Height_Gain)/((5 * 512) / 2); // move setpoint |
if(WaypointTrimming) |
{ |
if(abs(NCSetPointHeight - SetPointHeight) < 10) SetPointHeight = NCSetPointHeight; |
else SetPointHeight += WaypointTrimming; |
} |
else |
{ |
SetPointHeight += (HeightTrimming * ParamSet.Height_Gain)/((5 * 512) / 2); // move setpoint |
} |
HeightTrimming = 0; |
LIMIT_MIN_MAX(SetPointHeight, (ReadingHeight - 1024), (ReadingHeight + 1024)); // max. 10m deviation |
if(ParamSet.Config2 & CFG2_VARIO_BEEP) BeepTime = 100; |
//update hover gas stick value when setpoint is shifted |
if(!ParamSet.Height_StickNeutralPoint) |
if(!ParamSet.Height_StickNeutralPoint && (NCAltitudeSpeed == 0)) |
{ |
StickGasHover = HoverGas/STICK_GAIN; // rescale back to stick value |
StickGasHover = (StickGasHover * UBat) / LowVoltageWarning; |
/beta/Code Redesign killagreg/libfc1284.a |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/beta/Code Redesign killagreg/makefile |
---|
6,11 → 6,11 |
#------------------------------------------------------------------- |
VERSION_MAJOR = 0 |
VERSION_MINOR = 83 |
VERSION_PATCH = 4 |
VERSION_PATCH = 7 |
VERSION_SERIAL_MAJOR = 11 # Serial Protocol Major Version |
VERSION_SERIAL_MINOR = 0 # Serial Protocol Minor Version |
NC_SPI_COMPATIBLE = 18 # SPI Protocol Version |
NC_SPI_COMPATIBLE = 19 # SPI Protocol Version |
#------------------------------------------------------------------- |
#OPTIONS |
/beta/Code Redesign killagreg/spi.c |
---|
170,6 → 170,8 |
int8_t NCGpsZ = 0; |
int8_t NCRotate_C = 32, NCRotate_S = 0; |
int16_t NCCamNick = 0; // in 0.1° |
int32_t NCSetPointHeight = 0; |
int8_t NCAltitudeSpeed = 0; |
uint8_t NCErrorCode = 0; |
vector16_t MagVec = {0,0,0}; |
373,7 → 375,8 |
{ // if CareFree then NC can set compass course and nick offset |
CompassCourse = FromNaviCtrl.Param.sInt[4]; |
} |
NCCamNick = FromNaviCtrl.Param.sInt[5]; |
if(CareFree) NCCamNick = (NCCamNick + FromNaviCtrl.Param.sInt[5])/2; // update servo nick angle |
else NCCamNick = 0; // set neutral |
break; |
case SPI_NCCMD_VERSION: |
395,6 → 398,8 |
GPSInfo.HomeDistance = FromNaviCtrl.Param.Int[2]; |
GPSInfo.HomeBearing = FromNaviCtrl.Param.sInt[3]; |
PPM_in[MAX_CHANNELS-1] = (int16_t)FromNaviCtrl.Param.Byte[8]; // WP_EVENT-Channel-Value |
NCAltitudeSpeed = FromNaviCtrl.Param.Byte[9]; |
NCSetPointHeight = (int32_t)FromNaviCtrl.Param.sInt[5] * 10; // in steps of 1cm |
break; |
default: |
/beta/Code Redesign killagreg/spi.h |
---|
123,6 → 123,8 |
extern int8_t NCGpsZ; |
extern int8_t NCRotate_C, NCRotate_S; |
extern int16_t NCCamNick; |
extern int32_t NCSetPointHeight; |
extern int8_t NCAltitudeSpeed; |
extern uint8_t NCErrorCode; |
extern vector16_t MagVec; |
/beta/Code Redesign killagreg/uart0.c |
---|
154,17 → 154,17 |
"Motor 2 ", |
"Motor 3 ", |
"Motor 4 ", //15 |
"16 ", |
"17 ", |
"*Fusion ", |
"*CompDeviation ", |
"*AltSpeed ", |
"*AltSetPoint ", |
"*CompFusion ", |
"*CompCourseDev ", |
"NickServo ", //20 |
"Hovergas ", |
"Current [0.1A] ", |
"Capacity [mAh] ", |
"*Height SetPoint", |
"*CompassYawing ", //25 |
" ", |
"CompassYawing ", //25 |
" ", |
"CompassSetPoint ", |
"I2C-Error ", |
"BL Limit ", |
/beta/Code Redesign killagreg/vector.h |
---|
15,5 → 15,11 |
int16_t z; |
} __attribute__((packed)) vector16_t; |
typedef struct |
{ |
int8_t x; |
int8_t y; |
int8_t z; |
} __attribute__((packed)) vector8_t; |
#endif //_VECTOR_H |
/beta/Code Redesign killagreg/version.txt |
---|
432,20 → 432,23 |
- Unterstützung von 3,3V-Referenzspannung (nur ATMEGA128) |
0.83d H.Buss 09.02.2011 |
0.83i H.Buss 25.02.2011 |
- nur starten, wenn NC_ErrorCode = 0 |
- Beeptime von NC auch beim Kalibrieren durchlassen |
- Varible "JetiBeep" eingeführt |
- Kompass-Winkelvorgabe per NC-Datensatz |
- Kompass-Winkelvorgabe von NaviControl -> POI |
- Piepen beim Umschalten von CareFree |
- Compass-Routinen überarbeitet |
- Defaultvalues Servo-Min/MAx an MKDS18 angepasst |
- Dafaultvalues Servo-Min/MAx an MKDS18 angepasst |
- Defaultreceiver ist RECEIVER_JETI |
- GPS-Operation-Radius per default auf 245m |
- Höhenvorgabe im Vario-Mode durch Waypoints |
Anpassungen bzgl. V0.83 |
G.Stobrawa 31.01.2011 |
G.Stobrawa 04.03.2011 |
- Code stärker modularisiert und restrukturiert |
- viele Kommentare zur Erklärug eingefügt |