mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
commit
b1d1fba775
3 changed files with 17 additions and 1 deletions
|
@ -325,7 +325,7 @@ static const char * const lookupTableGyroOverflowCheck[] = {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char * const lookupTableRatesType[] = {
|
static const char * const lookupTableRatesType[] = {
|
||||||
"BETAFLIGHT", "RACEFLIGHT"
|
"BETAFLIGHT", "RACEFLIGHT", "KISS"
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef USE_OVERCLOCK
|
#ifdef USE_OVERCLOCK
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
typedef enum {
|
typedef enum {
|
||||||
RATES_TYPE_BETAFLIGHT = 0,
|
RATES_TYPE_BETAFLIGHT = 0,
|
||||||
RATES_TYPE_RACEFLIGHT,
|
RATES_TYPE_RACEFLIGHT,
|
||||||
|
RATES_TYPE_KISS,
|
||||||
} ratesType_e;
|
} ratesType_e;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|
|
@ -148,6 +148,17 @@ float applyRaceFlightRates(const int axis, float rcCommandf, const float rcComma
|
||||||
return angleRate;
|
return angleRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float applyKissRates(const int axis, float rcCommandf, const float rcCommandfAbs)
|
||||||
|
{
|
||||||
|
const float rcCurvef = currentControlRateProfile->rcExpo[axis] / 100.0f;
|
||||||
|
|
||||||
|
float kissRpyUseRates = 1.0f / (constrainf(1.0f - (rcCommandfAbs * (currentControlRateProfile->rates[axis] / 100.0f)), 0.01f, 1.00f));
|
||||||
|
float kissRcCommandf = (power3(rcCommandf) * rcCurvef + rcCommandf * (1 - rcCurvef)) * (currentControlRateProfile->rcRates[axis] / 1000.0f);
|
||||||
|
float kissAngle = constrainf(((2000.0f * kissRpyUseRates) * kissRcCommandf), -SETPOINT_RATE_LIMIT, SETPOINT_RATE_LIMIT);
|
||||||
|
|
||||||
|
return kissAngle;
|
||||||
|
}
|
||||||
|
|
||||||
static void calculateSetpointRate(int axis)
|
static void calculateSetpointRate(int axis)
|
||||||
{
|
{
|
||||||
float angleRate;
|
float angleRate;
|
||||||
|
@ -711,6 +722,10 @@ void initRcProcessing(void)
|
||||||
case RATES_TYPE_RACEFLIGHT:
|
case RATES_TYPE_RACEFLIGHT:
|
||||||
applyRates = applyRaceFlightRates;
|
applyRates = applyRaceFlightRates;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case RATES_TYPE_KISS:
|
||||||
|
applyRates = applyKissRates;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue