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

Copter: tradheli's implement spool logic #10212

Merged
merged 10 commits into from Jan 15, 2019

Conversation

rmackay9
Copy link
Contributor

@rmackay9 rmackay9 commented Jan 10, 2019

This PR is a subset of the contents of this PR from bnsgeyer. The main purpose of this PR is to make TradHeli's "spool logic" interface and implementation more consistent with Multicopters. We hope this will reduce the number of tradheli specific exceptions in the main code and make it easier to keep TradHeli up-to-date with new Multicopter features.

To provide some background, both TradHeli's and multicopters already implement "spooling" which means gradually increasing or decreasing the maximum turn rate of the motors but the implementation is very different. Even after this PR is merged, the parameters holding the different maximums are different but it is still a step in the right direction.

Multicopter parameters / TradHeli parameters:

  • MOT_SPIN_MIN, MOT_SPIN_MAX / No equivalent
  • MOT_SPIN_ARM / H_RSC_IDLE
  • MOT_SPOOL_TIME / H_RSC_RAMP_TIME & H_RSC_RUNUP_TIME

The major changes this makes to master are:

  • AP_Motors library's desired and actual spool state variables are moved from the Multicopter class up to the parent class (to allow TradHeli's to use them). Also the SPIN_WHEN_ARMED state of each is renamed to GROUND_IDLE.
  • AP_MotorsHeli implements the spool logic. Previously tradheli's completely ignored the vehicle code call's to set_desired_spool_state()
  • Copter vehicle code changes to reduce functional changes to Heli. TradHelis landed in non-autonomous modes (PosHold, Loiter, Drift, ZigZag, etc) only spool down the main rotor once the user disengages the interlock. In Multicopters they spool down once landed.
  • Copter, Sub, Plane and AC_AutoTune updated to use renamed GROUND_IDLE spool state

The TradHeli changes have been extensively tested by @bnsgeyer in RealFlight. There should be no functional changes to multicopters as a result of this PR.

As a side note there will be a follow up PR which makes further changes to the Copter vehicle code to make better use of the actual spool state. This including delaying the disarm until the main rotor has spooled down.

@rmackay9 rmackay9 requested a review from OXINARF January 14, 2019 11:06
@rmackay9 rmackay9 merged commit 8ba8717 into ArduPilot:master Jan 15, 2019
@rmackay9 rmackay9 deleted the bnsgeyer-spool-logic8 branch January 15, 2019 02:41
@rmackay9
Copy link
Contributor Author

Merged after testing with vagrant as discussed on the dev call

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

3 participants