Skip to content

Commit c20a85b

Browse files
committed
MR alt hold man rate fix + MF 5s cycle time
1 parent f467356 commit c20a85b

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

‎src/main/fc/settings.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3940,7 +3940,7 @@ groups:
39403940
field: multifunction_warning_cycle_time
39413941
min: 0
39423942
max: 60
3943-
default_value: 30
3943+
default_value: 5
39443944
# CR151
39453945
- name: PG_OSD_COMMON_CONFIG
39463946
type: osdCommonConfig_t

‎src/main/navigation/navigation_multicopter.c‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,11 @@ bool adjustMulticopterAltitudeFromRCInput(void)
149149
// Calculate max up or min down limit value scaled for deadband
150150
// CR139
151151
// int16_t limitValue = rcThrottleAdjustment > 0 ? getMaxThrottle() : getThrottleIdleValue();
152-
int16_t limitValue = rcThrottleAdjustment > 0 ? PWM_RANGE_MAX : PWM_RANGE_MIN;
153-
limitValue = applyDeadbandRescaled(limitValue - altHoldThrottleRCZero, rcControlsConfig()->alt_hold_deadband, -500, 500);
152+
// int16_t limitValue = rcThrottleAdjustment > 0 ? PWM_RANGE_MAX : PWM_RANGE_MIN;
153+
// limitValue = applyDeadbandRescaled(limitValue - altHoldThrottleRCZero, rcControlsConfig()->alt_hold_deadband, -500, 500);
154154
// CR139
155-
int16_t rcClimbRate = ABS(rcThrottleAdjustment) * navConfig()->mc.max_manual_climb_rate / limitValue;
155+
// int16_t rcClimbRate = ABS(rcThrottleAdjustment) * navConfig()->mc.max_manual_climb_rate / limitValue;
156+
int16_t rcClimbRate = rcThrottleAdjustment * navConfig()->mc.max_manual_climb_rate / 500;
156157

157158
// DEBUG_SET(DEBUG_ALWAYS, 4, rcThrottleAdjustment);
158159
// DEBUG_SET(DEBUG_ALWAYS, 5, rcClimbRate);
@@ -595,24 +596,24 @@ static void checkForToiletBowling(void)
595596
startTime = 0;
596597
}
597598

598-
DEBUG_SET(DEBUG_ALWAYS, 0, courseError);
599-
DEBUG_SET(DEBUG_ALWAYS, 2, posControl.actualState.velXY * distanceToHoldPoint);
599+
// DEBUG_SET(DEBUG_ALWAYS, 0, courseError);
600+
// DEBUG_SET(DEBUG_ALWAYS, 2, posControl.actualState.velXY * distanceToHoldPoint);
600601
}
601602
// CR141
602603
static void updatePositionAccelController_MC(timeDelta_t deltaMicros, float maxAccelLimit) // , const float maxSpeed) CR47
603604
{
604605
// CR141
605-
DEBUG_SET(DEBUG_ALWAYS, 1, calculateDistanceToDestination(&posControl.desiredState.pos));
606-
DEBUG_SET(DEBUG_ALWAYS, 3, mcToiletBowlingHeadingCorrection);
607-
DEBUG_SET(DEBUG_ALWAYS, 5, posControl.actualState.velXY);
608-
DEBUG_SET(DEBUG_ALWAYS, 6, calculateBearingToDestination(&posControl.desiredState.pos));
609-
DEBUG_SET(DEBUG_ALWAYS, 7, posControl.actualState.yaw);
606+
// DEBUG_SET(DEBUG_ALWAYS, 1, calculateDistanceToDestination(&posControl.desiredState.pos));
607+
// DEBUG_SET(DEBUG_ALWAYS, 3, mcToiletBowlingHeadingCorrection);
608+
// DEBUG_SET(DEBUG_ALWAYS, 5, posControl.actualState.velXY);
609+
// DEBUG_SET(DEBUG_ALWAYS, 6, calculateBearingToDestination(&posControl.desiredState.pos));
610+
// DEBUG_SET(DEBUG_ALWAYS, 7, posControl.actualState.yaw);
610611
if (navConfig()->mc.toiletbowl_detection) {
611612
if (mcToiletBowlingHeadingCorrection) {
612613
uint16_t correctedHeading = wrap_36000(posControl.actualState.yaw - mcToiletBowlingHeadingCorrection);
613614
posControl.actualState.sinYaw = sin_approx(CENTIDEGREES_TO_RADIANS(correctedHeading));
614615
posControl.actualState.cosYaw = cos_approx(CENTIDEGREES_TO_RADIANS(correctedHeading));
615-
DEBUG_SET(DEBUG_ALWAYS, 4, correctedHeading);
616+
// DEBUG_SET(DEBUG_ALWAYS, 4, correctedHeading);
616617
} else {
617618
checkForToiletBowling();
618619
}

0 commit comments

Comments
 (0)