1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

unlocked firmware, added boost mode to modes

This commit is contained in:
skyfpv 2024-04-23 15:34:01 -06:00
parent 6a18355d2b
commit fe9561efed
5 changed files with 11 additions and 9 deletions

View file

@ -948,7 +948,6 @@ const clivalue_t valueTable[] = {
{ "rpm_limiter_afterburner_reset", VAR_INT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_MIXER_CONFIG, offsetof(mixerConfig_t, govenor_rpm_afterburner_reset) },
{ "rpm_limiter_acceleration_limit", VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 0, 1000 }, PG_MIXER_CONFIG, offsetof(mixerConfig_t, govenor_acceleration_limit) },
//Street League customization
//{ "rpm_limiter_idle_rpm", VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 0, 30 }, PG_MIXER_CONFIG, offsetof(mixerConfig_t, govenor_idle_rpm) },
{ "rpm_limiter_idle_rpm", VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 0, 999 }, PG_MIXER_CONFIG, offsetof(mixerConfig_t, govenor_idle_rpm) },
{ "rpm_limiter_full_linearization", VAR_INT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_MIXER_CONFIG, offsetof(mixerConfig_t, govenor_rpm_linearization) },

View file

@ -78,6 +78,7 @@ typedef enum {
BOXSTICKCOMMANDDISABLE,
BOXBEEPERMUTE,
BOXREADY,
BOXBOOST,
CHECKBOX_ITEM_COUNT
} boxId_e;

View file

@ -370,7 +370,7 @@ static void applyRPMLimiter(void)
//if drone is armed
if (ARMING_FLAG(ARMED)) {
//if the afterburner switch is engaged
if(IS_RC_MODE_ACTIVE(BOXBEEPERON)) {
if(IS_RC_MODE_ACTIVE(BOXBOOST)) {
//if the afterburner isn't initiated
if(mixerRuntime.afterburnerInitiated == false) {
//if there's charge in the tank

View file

@ -52,17 +52,17 @@ PG_RESET_TEMPLATE(mixerConfig_t, mixerConfig,
.crashflip_motor_percent = 0,
.crashflip_expo = 0,
.govenor = true,
.govenor_p = 20,
.govenor_i = 15,
.govenor_d = 10,
.govenor_p = 20.0f,
.govenor_i = 15.0f,
.govenor_d = 10.0f,
.govenor_rpm_linearization = true,
.govenor_idle_rpm = 17,
.govenor_acceleration_limit = 60,
.govenor_deceleration_limit = 60,
.govenor_rpm_limit = 130,
.govenor_rpm_limit = 130.0f,
.govenor_rpm_afterburner = 16,
.govenor_rpm_afterburner_duration = 5,
.govenor_rpm_afterburner_reset = true,
.govenor_rpm_afterburner_reset = false,
.govenor_rpm_afterburner_hold_to_use = false,
.govenor_rpm_afterburner_tank_count = 3,
.mixer_type = MIXER_LEGACY,
@ -343,7 +343,7 @@ mixerRuntime.motorPoleCount = 14;
mixerRuntime.govenorEnabled = true;
//Unlocked rpm settings
/*mixerRuntime.govenorPGain = mixerConfig()->govenor_p * 0.0000015f;
mixerRuntime.govenorPGain = mixerConfig()->govenor_p * 0.0000015f;
mixerRuntime.govenorIGain = mixerConfig()->govenor_i * 0.0001f * pidGetDT();
mixerRuntime.govenorDGain = mixerConfig()->govenor_d * 0.00000003f * pidGetPidFrequency();
mixerRuntime.govenorAccelerationLimit = mixerConfig()->govenor_acceleration_limit * 1000.0f * pidGetDT();
@ -356,7 +356,7 @@ mixerRuntime.afterburnerHoldToBoost = mixerConfig()->govenor_rpm_afterburner_hol
mixerRuntime.rpmLinearization = mixerConfig()->govenor_rpm_linearization;
mixerRuntime.RPMLimit = mixerConfig()->govenor_rpm_limit;
mixerRuntime.motorPoleCount = motorConfig()->motorPoleCount;
mixerRuntime.govenorEnabled = mixerConfig()->govenor;*/
mixerRuntime.govenorEnabled = mixerConfig()->govenor;
mixerRuntime.govenorI = 0;

View file

@ -101,6 +101,7 @@ static const box_t boxes[CHECKBOX_ITEM_COUNT] = {
{ .boxId = BOXSTICKCOMMANDDISABLE, .boxName = "STICK COMMANDS DISABLE", .permanentId = 51},
{ .boxId = BOXBEEPERMUTE, .boxName = "BEEPER MUTE", .permanentId = 52},
{ .boxId = BOXREADY, .boxName = "READY", .permanentId = 53},
{ .boxId = BOXBOOST, .boxName = "BOOST", .permanentId = 54},
};
// mask of enabled IDs, calculated on startup based on enabled features. boxId_e is used as bit index
@ -187,6 +188,7 @@ void initActiveBoxIds(void)
#define BME(boxId) do { bitArraySet(&ena, boxId); } while (0)
BME(BOXARM);
BME(BOXPREARM);
BME(BOXBOOST);
if (!featureIsEnabled(FEATURE_AIRMODE)) {
BME(BOXAIRMODE);
}