Skip to content

Commit e071f1c

Browse files
committed
new custom branch
1 parent ccdbecf commit e071f1c

48 files changed

Lines changed: 1132 additions & 682 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/Settings.md

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,7 +2318,7 @@ Calculated 1G of Acc axis Z to use in INS
23182318

23192319
| Default | Min | Max |
23202320
| --- | --- | --- |
2321-
| 0.0 | 0 | 2000 |
2321+
| 0 | 0 | 2000 |
23222322

23232323
---
23242324

@@ -3064,7 +3064,7 @@ Protocol that is used to send motor updates to ESCs. Possible values - STANDARD,
30643064

30653065
### motor_pwm_rate
30663066

3067-
Output frequency (in Hz) for motor pins. Applies only to brushed motors.
3067+
Output frequency (in Hz) for motor pins. Applies only to brushed motors.
30683068

30693069
| Default | Min | Max |
30703070
| --- | --- | --- |
@@ -3362,6 +3362,16 @@ Forward acceleration threshold for bungee launch or throw launch [cm/s/s], 1G =
33623362

33633363
---
33643364

3365+
### nav_fw_launch_allow_throttle_low
3366+
3367+
Allow launch sequence with throttle maintained low throughout. When main launch sequence completes control is maintained with Nav cruise throttle until sticks moved/throttle raised or control switches to other Nav mode if preselected
3368+
3369+
| Default | Min | Max |
3370+
| --- | --- | --- |
3371+
| OFF | OFF | ON |
3372+
3373+
---
3374+
33653375
### nav_fw_launch_climb_angle
33663376

33673377
Climb angle (attitude of model, not climb slope) for launch sequence (degrees), is also restrained by global max_angle_inclination_pit
@@ -4052,6 +4062,16 @@ P gain of altitude PID controller (Multirotor)
40524062

40534063
---
40544064

4065+
### nav_mc_toiletbowl_detection
4066+
4067+
Sets sensitivity of toilet bowling detection for multirotors. On detection a heading correction is applied which should stop the toilet bowling. A setting of 2 works well for 5 inch multirotors. Increasing the setting will reduce sensitivity and delay detection. Set to 0 to disable. (Toilet bowling occurs most obviously during position hold when an inaccurate compass heading causes a rapidly increasing fast sweeping bowl shaped flight path).
4068+
4069+
| Default | Min | Max |
4070+
| --- | --- | --- |
4071+
| 0 | 0 | 20 |
4072+
4073+
---
4074+
40554075
### nav_mc_vel_xy_d
40564076

40574077
D gain of Position-Rate (Velocity to Acceleration) PID controller. It can damp P and I. Increasing D might help when drone overshoots target.
@@ -4072,23 +4092,23 @@ Maximum D-term attenution percentage for horizontal velocity PID controller (Mul
40724092

40734093
---
40744094

4075-
### nav_mc_vel_xy_dterm_attenuation_end
4095+
### nav_mc_vel_xy_dterm_attenuation_end_speed
40764096

4077-
A point (in percent of both target and current horizontal velocity) where nav_mc_vel_xy_dterm_attenuation reaches maximum
4097+
Horizontal speed at which nav_mc_vel_xy_dterm_attenuation reaches maximum [m/s]
40784098

40794099
| Default | Min | Max |
40804100
| --- | --- | --- |
4081-
| 60 | 0 | 100 |
4101+
| 10 | 0 | 100 |
40824102

40834103
---
40844104

4085-
### nav_mc_vel_xy_dterm_attenuation_start
4105+
### nav_mc_vel_xy_dterm_attenuation_start_speed
40864106

4087-
A point (in percent of both target and current horizontal velocity) where nav_mc_vel_xy_dterm_attenuation begins
4107+
Horizontal speed at which nav_mc_vel_xy_dterm_attenuation begins [m/s]
40884108

40894109
| Default | Min | Max |
40904110
| --- | --- | --- |
4091-
| 10 | 0 | 100 |
4111+
| 5 | 0 | 100 |
40924112

40934113
---
40944114

@@ -6372,6 +6392,16 @@ Which aux channel to use to change serial output & baud rate (MSP / Telemetry).
63726392

63736393
---
63746394

6395+
### test_setting
6396+
6397+
For developer use. General use test setting from -1000 to 1000
6398+
6399+
| Default | Min | Max |
6400+
| --- | --- | --- |
6401+
| 0 | -1000 | 1000 |
6402+
6403+
---
6404+
63756405
### thr_comp_weight
63766406

63776407
Weight used for the throttle compensation based on battery voltage. See the [battery documentation](Battery.md#automatic-throttle-compensation-based-on-battery-voltage)

src/main/cms/cms_menu_imu.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ static const OSD_Entry cmsx_menuPidGpsnavEntries[] =
283283
OTHER_PIDFF_ENTRY("VEL I", &cmsx_pidVelXY.I),
284284
OTHER_PIDFF_ENTRY("VEL D", &cmsx_pidVelXY.D),
285285
OTHER_PIDFF_ENTRY("VEL FF", &cmsx_pidVelXY.FF),
286-
287286
OSD_BACK_AND_END_ENTRY,
288287
};
289288

@@ -463,6 +462,8 @@ static const OSD_Entry cmsx_menuMechanicsEntries[] =
463462
OSD_SETTING_ENTRY("ITERM RELAX", SETTING_MC_ITERM_RELAX),
464463
OSD_SETTING_ENTRY("ITERM CUTOFF", SETTING_MC_ITERM_RELAX_CUTOFF),
465464
OSD_SETTING_ENTRY("CD LPF", SETTING_MC_CD_LPF_HZ),
465+
OSD_SETTING_ENTRY("MC DTERM ATT START", SETTING_NAV_MC_VEL_XY_DTERM_ATTENUATION_START_SPEED), //CR47
466+
OSD_SETTING_ENTRY("MC DTERM ATT END", SETTING_NAV_MC_VEL_XY_DTERM_ATTENUATION_END_SPEED), //CR47
466467

467468
OSD_BACK_AND_END_ENTRY,
468469
};
@@ -492,7 +493,7 @@ static const OSD_Entry cmsx_menuImuEntries[] =
492493
OSD_SUBMENU_ENTRY("MECHANICS", &cmsx_menuMechanics),
493494

494495
// Rate profile dependent
495-
OSD_UINT8_CALLBACK_ENTRY("RATE PROF", cmsx_profileIndexOnChange, (&(const OSD_UINT8_t){ &tmpProfileIndex, 1, MAX_CONTROL_PROFILE_COUNT, 1})),
496+
// OSD_UINT8_CALLBACK_ENTRY("RATE PROF", cmsx_profileIndexOnChange, (&(const OSD_UINT8_t){ &tmpProfileIndex, 1, MAX_CONTROL_PROFILE_COUNT, 1})),
496497
OSD_SUBMENU_ENTRY("RATE", &cmsx_menuRateProfile),
497498
OSD_SUBMENU_ENTRY("MANU RATE", &cmsx_menuManualRateProfile),
498499

src/main/cms/cms_menu_misc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ static const OSD_Entry menuMiscEntries[]=
4545
OSD_SETTING_ENTRY("THR IDLE", SETTING_THROTTLE_IDLE),
4646
#ifdef USE_DEV_TOOLS
4747
OSD_SETTING_ENTRY("GROUND TEST MODE", SETTING_GROUND_TEST_MODE),
48+
OSD_SETTING_ENTRY("DEV TEST SETTING", SETTING_TEST_SETTING), // CR143
4849
#endif
4950
#ifdef USE_OSD
5051
#ifdef USE_ADC

src/main/cms/cms_menu_navigation.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ static const OSD_Entry cmsx_menuNavSettingsEntries[] =
5151
OSD_SETTING_ENTRY("MC MAX BANK ANGLE", SETTING_NAV_MC_BANK_ANGLE),
5252
OSD_SETTING_ENTRY("MC ALTHOLD THROT", SETTING_NAV_MC_ALTHOLD_THROTTLE),
5353
OSD_SETTING_ENTRY("MC HOVER THR", SETTING_NAV_MC_HOVER_THR),
54+
OSD_SETTING_ENTRY("USE FW YAW CONTROL", SETTING_NAV_USE_FW_YAW_CONTROL),
55+
OSD_SETTING_ENTRY("LAND SENSITIVITY", SETTING_NAV_LAND_DETECT_SENSITIVITY),
5456
OSD_SETTING_ENTRY("LANDING DISARM", SETTING_NAV_DISARM_ON_LANDING),
5557

5658
OSD_BACK_AND_END_ENTRY,
@@ -106,7 +108,7 @@ static const CMS_Menu cmsx_menuRTH = {
106108

107109
static const OSD_Entry cmsx_menuFWCruiseEntries[] =
108110
{
109-
OSD_LABEL_ENTRY("-- CRUISE --"),
111+
OSD_LABEL_ENTRY("-- GENERAL --"),
110112

111113
OSD_SETTING_ENTRY("CRUISE THROTTLE", SETTING_NAV_FW_CRUISE_THR),
112114
OSD_SETTING_ENTRY("MIN THROTTLE", SETTING_NAV_FW_MIN_THR),
@@ -172,7 +174,7 @@ static const OSD_Entry cmsx_menuFWSettingsEntries[] =
172174
OSD_LABEL_ENTRY("-- FIXED WING --"),
173175

174176
OSD_SUBMENU_ENTRY("AUTOLAUNCH", &cmsx_menuFWLaunch),
175-
OSD_SUBMENU_ENTRY("CRUISE", &cmsx_menuFWCruise),
177+
OSD_SUBMENU_ENTRY("GENERAL", &cmsx_menuFWCruise),
176178

177179
OSD_BACK_AND_END_ENTRY,
178180
};
@@ -193,6 +195,7 @@ static const OSD_Entry cmsx_menuMissionSettingsEntries[] =
193195
OSD_LABEL_ENTRY("-- MISSIONS --"),
194196

195197
OSD_SETTING_ENTRY("MC WP SLOWDOWN", SETTING_NAV_MC_WP_SLOWDOWN),
198+
OSD_SETTING_ENTRY("MISSION RESTART", SETTING_NAV_WP_MISSION_RESTART),
196199
OSD_SETTING_ENTRY("WP FAILSAFE DELAY", SETTING_FAILSAFE_MISSION_DELAY),
197200
OSD_SETTING_ENTRY("WP LOAD ON BOOT", SETTING_NAV_WP_LOAD_ON_BOOT),
198201
OSD_SETTING_ENTRY("WP REACHED RADIUS", SETTING_NAV_WP_RADIUS),
@@ -201,7 +204,6 @@ static const OSD_Entry cmsx_menuMissionSettingsEntries[] =
201204
#ifdef USE_MULTI_MISSION
202205
OSD_SETTING_ENTRY("MULTI MISSION NUMBER", SETTING_NAV_WP_MULTI_MISSION_INDEX),
203206
#endif
204-
OSD_SETTING_ENTRY("MISSION RESTART", SETTING_NAV_WP_MISSION_RESTART),
205207
OSD_SETTING_ENTRY("WP TURN SMOOTHING", SETTING_NAV_FW_WP_TURN_SMOOTHING),
206208
OSD_SETTING_ENTRY("WP TRACKING ACCURACY", SETTING_NAV_FW_WP_TRACKING_ACCURACY),
207209
OSD_BACK_AND_END_ENTRY,

src/main/common/fp_pid.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ float navPidApply3(
4646
) {
4747
float newProportional, newDerivative, newFeedForward;
4848
float error = 0.0f;
49-
49+
5050
if (pid->errorLpfHz > 0.0f) {
5151
error = pt1FilterApply4(&pid->error_filter_state, setpoint - measurement, pid->errorLpfHz, dt);
5252
} else {
@@ -107,7 +107,7 @@ float navPidApply3(
107107
/* Update I-term */
108108
if (
109109
!(pidFlags & PID_ZERO_INTEGRATOR) &&
110-
!(pidFlags & PID_FREEZE_INTEGRATOR)
110+
!(pidFlags & PID_FREEZE_INTEGRATOR)
111111
) {
112112
const float newIntegrator = pid->integrator + (error * pid->param.kI * gainScaler * dt) + (backCalc * pid->param.kT * dt);
113113

@@ -121,10 +121,10 @@ float navPidApply3(
121121
pid->integrator = newIntegrator;
122122
}
123123
}
124-
124+
125125
if (pidFlags & PID_LIMIT_INTEGRATOR) {
126126
pid->integrator = constrainf(pid->integrator, outMin, outMax);
127-
}
127+
}
128128

129129
return outValConstrained;
130130
}

src/main/common/time.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ typedef uint32_t timeUs_t;
5858
#define MS2S(ms) ((ms) * 1e-3f)
5959
#define S2MS(s) ((s) * MILLISECS_PER_SEC)
6060
#define DS2MS(ds) ((ds) * 100)
61-
#define HZ2S(hz) US2S(HZ2US(hz))
61+
#define HZ2S(hz) (1.0f / (hz)) // US2S(HZ2US(hz)) CR152.1
6262

6363
// Use this function only to get small deltas (difference overflows at ~35 minutes)
6464
static inline timeDelta_t cmpTimeUs(timeUs_t a, timeUs_t b) { return (timeDelta_t)(a - b); }

src/main/drivers/display.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ int displayWriteChar(displayPort_t *instance, uint8_t x, uint8_t y, uint16_t c)
178178

179179
#ifdef USE_SIMULATOR
180180
if (ARMING_FLAG(SIMULATOR_MODE_HITL)) {
181-
//some FCs do not power max7456 from USB power
182-
//driver can not read font metadata
181+
//some FCs do not power max7456 from USB power
182+
//driver can not read font metadata
183183
//chip assumed to not support second bank of font
184184
//artifical horizon, variometer and home direction are not drawn ( display.c: displayUpdateMaxChar())
185185
//return dummy metadata to let all OSD elements to work in simulator mode

src/main/fc/config.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ PG_RESET_TEMPLATE(systemConfig_t, systemConfig,
112112
.debug_mode = SETTING_DEBUG_MODE_DEFAULT,
113113
#ifdef USE_DEV_TOOLS
114114
.groundTestMode = SETTING_GROUND_TEST_MODE_DEFAULT, // disables motors, set heading trusted for FW (for dev use)
115+
.devTestSetting = SETTING_TEST_SETTING_DEFAULT, // CR143
115116
#endif
116117
#ifdef USE_I2C
117118
.i2c_speed = SETTING_I2C_SPEED_DEFAULT,

src/main/fc/config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ typedef struct systemConfig_s {
7373
uint8_t debug_mode;
7474
#ifdef USE_DEV_TOOLS
7575
bool groundTestMode; // Disables motor ouput, sets heading trusted on FW (for dev use)
76+
int16_t devTestSetting; // CR143
7677
#endif
7778
#ifdef USE_I2C
7879
uint8_t i2c_speed;

src/main/fc/fc_core.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,7 @@ bool emergInflightRearmEnabled(void)
508508
timeMs_t currentTimeMs = millis();
509509
emergRearmStabiliseTimeout = 0;
510510

511-
if ((lastDisarmReason != DISARM_SWITCH) ||
512-
(currentTimeMs > US2MS(lastDisarmTimeUs) + EMERGENCY_INFLIGHT_REARM_TIME_WINDOW_MS)) {
511+
if ((lastDisarmReason != DISARM_SWITCH) || (currentTimeMs > US2MS(lastDisarmTimeUs) + EMERGENCY_INFLIGHT_REARM_TIME_WINDOW_MS)) {
513512
return false;
514513
}
515514

@@ -546,7 +545,6 @@ void tryArm(void)
546545
return;
547546
}
548547
#endif
549-
550548
#ifdef USE_PROGRAMMING_FRAMEWORK
551549
if (emergInflightRearmEnabled() || !isArmingDisabled() || emergencyArmingIsEnabled() ||
552550
LOGIC_CONDITION_GLOBAL_FLAG(LOGIC_CONDITION_GLOBAL_FLAG_OVERRIDE_ARMING_SAFETY)) {
@@ -729,7 +727,7 @@ void processRx(timeUs_t currentTimeUs)
729727
// Handle passthrough mode
730728
if (STATE(FIXED_WING_LEGACY)) {
731729
if ((IS_RC_MODE_ACTIVE(BOXMANUAL) && !navigationRequiresAngleMode() && !failsafeRequiresAngleMode()) || // Normal activation of passthrough
732-
(!ARMING_FLAG(ARMED) && areSensorsCalibrating())){ // Backup - if we are not armed - enforce passthrough while calibrating
730+
(!ARMING_FLAG(ARMED) && areSensorsCalibrating())) { // Backup - if we are not armed - enforce passthrough while calibrating
733731
ENABLE_FLIGHT_MODE(MANUAL_MODE);
734732
} else {
735733
DISABLE_FLIGHT_MODE(MANUAL_MODE);
@@ -906,7 +904,6 @@ static void processBlackbox(void)
906904
#endif
907905
void taskMainPidLoop(timeUs_t currentTimeUs)
908906
{
909-
910907
cycleTime = getTaskDeltaTime(TASK_SELF);
911908
dT = (float)cycleTime * 0.000001f;
912909

@@ -1013,6 +1010,7 @@ void taskMainPidLoop(timeUs_t currentTimeUs)
10131010
processBlackbox();
10141011
}
10151012
#endif
1013+
10161014
}
10171015

10181016
// This function is called in a busy-loop, everything called from here should do it's own

0 commit comments

Comments
 (0)