Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plane: Quadplane: check for valid RC before passing throttle to outputs #25631

Closed

Conversation

IamPete1
Copy link
Member

Extract from #25416

This ensures that pilot throttle is valid before outputting to motors. These two special cases are a outside of our typical code paths so its a good idea to double check.

In both cases currently it is possible that the throttle will be hard coded to 50% here:

case Mode::Number::QSTABILIZE:
case Mode::Number::QHOVER:
case Mode::Number::QLOITER:
case Mode::Number::QLAND: // throttle is ignored, but reset anyways
case Mode::Number::QRTL: // throttle is ignored, but reset anyways
case Mode::Number::QACRO:
#if QAUTOTUNE_ENABLED
case Mode::Number::QAUTOTUNE:
#endif
if (quadplane.available() && quadplane.motors->get_desired_spool_state() > AP_Motors::DesiredSpoolState::GROUND_IDLE) {
// set half throttle to avoid descending at maximum rate, still has a slight descent due to throttle deadzone
channel_throttle->set_control_in(channel_throttle->get_range() / 2);
break;
}

I suspect its fine and we keep the spool state at shut down but this ensures we never output the wrong thing.

@IamPete1
Copy link
Member Author

I found the problem affected more areas than expected so went with a more general fix, #25633

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant