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: booster output respects safety switch #9271

Merged
merged 2 commits into from
Aug 27, 2018

Conversation

rmackay9
Copy link
Contributor

Copter-3.6 (and higher) support a "booster" motor for multicopters (blog). These are configured by setting SERVOx_FUNCTION to 81 (boost_throttle) and then setting MOT_BOOST_SCALE to a postive number from 0 to 1.

This PR enables the output to the booster to reflect the safety switch instead of enabling it along with other "auxiliary" outputs (used for gimbals, etc).

This has been tested on an mRobotics Pixhawk1 under NuttX:

  • connected a servo tester to read the output from MAIN OUT 5 of the pixhawk
  • set MOT_BOOST_SCALE = 0.5, SERVO5_FUNCTION = 81
  • rebooted pixhawk
  • with safety switch unpressed (disengaged?), no PWM pulses were sent
  • with safety switch pressed, PWM values were output (same value as held in SERVO5_MIN)

This item was reported in this Copter-3.6 beta testing thread.

P.S. I'm not totally overjoyed with the complexity of implementing the get_motor_mask() in the AP_MotorsMulticopter class and then calling it from all the children. I considered two other alternatives before implementing it this way:

  • modify each child class's get_motor_mask() function to include the boost channel (overall less code actually).
  • add a get_motor_mask_multicopter (or similar) and force the children to override this method instead of get_motor_mask (this would remove the need for the children to call the parent).

@rmackay9
Copy link
Contributor Author

@tridge has quickly reviewed this and gave his OK. I'll merge on Monday but if any other opinions are also greatly appreciated.

Copy link
Member

@OXINARF OXINARF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rmackay9 rmackay9 merged commit a5c59ce into ArduPilot:master Aug 27, 2018
@rmackay9 rmackay9 deleted the copter-boost-enable-fix branch August 27, 2018 01:35
@rmackay9
Copy link
Contributor Author

great, thanks for the reviews, merged!

@rmackay9 rmackay9 moved this from PRs to 3.6.0-rc8 in Copter 3.6 Backports Aug 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Copter 3.6 Backports
  
3.6.0-rc8
Development

Successfully merging this pull request may close these issues.

None yet

2 participants