3,7 → 3,6 |
#include "attitude.h" |
#include "configuration.h" |
#include "controlMixer.h" |
|
// for digital / LED debug. |
#include "output.h" |
|
14,6 → 13,12 |
|
#define LATCH_TIME 3 |
|
// This will translate a height value to a target height in centimeters. |
// Currently: One step is 50 cm and zero is 5 meters below the takeoff altitude. With max. 255 steps the max. |
// target height is then about 120m. |
#define HEIGHT_GAIN 50L |
#define HEIGHT_FORMULA(x) ((x) * HEIGHT_GAIN - 500L) |
|
int32_t setHeight; |
int32_t targetHeight; |
|
64,7 → 69,7 |
} |
} else { |
// Switch is not activated; take the "max-height" as the target height. |
setHeight = (uint16_t) dynamicParams.heightSetting * 25L - 500L; // should be: 100 (or make a param out of it) |
setHeight = (uint16_t) (HEIGHT_FORMULA(dynamicParams.heightSetting)); // should be: 100 (or make a param out of it) |
} |
|
/* |
107,7 → 112,7 |
if (hc_testOscTimer < staticParams.heightControlTestOscPeriod/2) |
targetHeight = setHeight; |
else |
targetHeight = setHeight + (uint16_t)staticParams.heightControlTestOscAmplitude * 25L; |
targetHeight = setHeight + (uint16_t)staticParams.heightControlTestOscAmplitude * HEIGHT_GAIN; |
|
//if (staticParams.) |
// height, in meters (so the division factor is: 100) |