Rev 1857 | Rev 1862 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1857 | Rev 1861 | ||
---|---|---|---|
Line 158... | Line 158... | ||
158 | const signed char sintab[31] = { 0, 2, 4, 6, 7, 8, 8, 8, 7, 6, 4, 2, 0, -2, -4, -6, -7, -8, -8, -8, -7, -6, -4, -2, 0, 2, 4, 6, 7, 8, 8}; |
158 | const signed char sintab[31] = { 0, 2, 4, 6, 7, 8, 8, 8, 7, 6, 4, 2, 0, -2, -4, -6, -7, -8, -8, -8, -7, -6, -4, -2, 0, 2, 4, 6, 7, 8, 8}; |
Line 159... | Line 159... | ||
159 | 159 | ||
160 | signed int ExternStickNick = 0,ExternStickRoll = 0,ExternStickGier = 0, ExternHoehenValue = -20; |
160 | signed int ExternStickNick = 0,ExternStickRoll = 0,ExternStickGier = 0, ExternHoehenValue = -20; |
161 | int MaxStickNick = 0,MaxStickRoll = 0; |
161 | int MaxStickNick = 0,MaxStickRoll = 0; |
162 | unsigned int modell_fliegt = 0; |
162 | unsigned int modell_fliegt = 0; |
163 | volatile unsigned char FC_StatusFlags = 0; |
163 | volatile unsigned char FC_StatusFlags = 0, FC_StatusFlags2 = 0; |
164 | long GIER_GRAD_FAKTOR = 1291; |
164 | long GIER_GRAD_FAKTOR = 1291; |
165 | signed int KopplungsteilNickRoll,KopplungsteilRollNick; |
165 | signed int KopplungsteilNickRoll,KopplungsteilRollNick; |
166 | signed int tmp_motorwert[MAX_MOTORS]; |
166 | signed int tmp_motorwert[MAX_MOTORS]; |
Line 635... | Line 635... | ||
635 | { |
635 | { |
636 | beeptime = 15000; |
636 | beeptime = 15000; |
637 | BeepMuster = 0xA400; |
637 | BeepMuster = 0xA400; |
638 | CareFree = 0; |
638 | CareFree = 0; |
639 | } |
639 | } |
640 | - | ||
641 | if(CareFree) {if(Parameter_AchsKopplung1 < 210) Parameter_AchsKopplung1 += 30;} |
640 | if(CareFree) { FC_StatusFlags2 |= FC_STATUS2_CAREFREE; if(Parameter_AchsKopplung1 < 210) Parameter_AchsKopplung1 += 30;} else FC_StatusFlags2 &= ~FC_STATUS2_CAREFREE; |
642 | } |
641 | } |
Line 643... | Line 642... | ||
643 | 642 | ||
644 | //############################################################################ |
643 | //############################################################################ |
645 | // |
644 | // |
Line 1437... | Line 1436... | ||
1437 | // Holger original version |
1436 | // Holger original version |
1438 | // start of height control algorithm |
1437 | // start of height control algorithm |
1439 | // the height control is only an attenuation of the actual gas stick. |
1438 | // the height control is only an attenuation of the actual gas stick. |
1440 | // I.e. it will work only if the gas stick is higher than the hover gas |
1439 | // I.e. it will work only if the gas stick is higher than the hover gas |
1441 | // and the hover height will be allways larger than height setpoint. |
1440 | // and the hover height will be allways larger than height setpoint. |
- | 1441 | FC_StatusFlags2 |= FC_STATUS2_ALTITUDE_CONTROL; |
|
1442 | if((EE_Parameter.ExtraConfig & CFG2_HEIGHT_LIMIT) || !(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER)) // Regler wird über Schalter gesteuert) |
1442 | if((EE_Parameter.ExtraConfig & CFG2_HEIGHT_LIMIT) || !(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER)) // Regler wird über Schalter gesteuert) |
1443 | { // old version |
1443 | { // old version |
1444 | HCGas = GasMischanteil; // take current stick gas as neutral point for the height control |
1444 | HCGas = GasMischanteil; // take current stick gas as neutral point for the height control |
1445 | HeightTrimming = 0; |
1445 | HeightTrimming = 0; |
1446 | // set both flags to indicate no vario mode |
1446 | // set both flags to indicate no vario mode |
Line 1637... | Line 1637... | ||
1637 | else StickGasHover = EE_Parameter.Hoehe_StickNeutralPoint; |
1637 | else StickGasHover = EE_Parameter.Hoehe_StickNeutralPoint; |
1638 | LIMIT_MIN_MAX(StickGasHover, 70, 150); // reserve some range for trim up and down |
1638 | LIMIT_MIN_MAX(StickGasHover, 70, 150); // reserve some range for trim up and down |
1639 | FilterHCGas = GasMischanteil; |
1639 | FilterHCGas = GasMischanteil; |
1640 | // set both flags to indicate no vario mode |
1640 | // set both flags to indicate no vario mode |
1641 | FC_StatusFlags |= (FC_STATUS_VARIO_TRIM_UP|FC_STATUS_VARIO_TRIM_DOWN); |
1641 | FC_StatusFlags |= (FC_STATUS_VARIO_TRIM_UP|FC_STATUS_VARIO_TRIM_DOWN); |
- | 1642 | FC_StatusFlags2 &= ~FC_STATUS2_ALTITUDE_CONTROL; |
|
1642 | } |
1643 | } |
1643 | - | ||
1644 | // Hover gas estimation by averaging gas control output on small z-velocities |
1644 | // Hover gas estimation by averaging gas control output on small z-velocities |
1645 | // this is done only if height contol option is selected in global config and aircraft is flying |
1645 | // this is done only if height contol option is selected in global config and aircraft is flying |
1646 | if((FC_StatusFlags & FC_STATUS_FLY))// && !(FC_SatusFlags & FC_STATUS_EMERGENCY_LANDING)) |
1646 | if((FC_StatusFlags & FC_STATUS_FLY))// && !(FC_SatusFlags & FC_STATUS_EMERGENCY_LANDING)) |
1647 | { |
1647 | { |
1648 | if(HoverGasFilter == 0 || StartTrigger == 1) HoverGasFilter = HOVER_GAS_AVERAGE * (unsigned long)(GasMischanteil); // init estimation |
1648 | if(HoverGasFilter == 0 || StartTrigger == 1) HoverGasFilter = HOVER_GAS_AVERAGE * (unsigned long)(GasMischanteil); // init estimation |