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

Automatically pitch down in angle mode when throttle is bellow cruise throttle #3290

Conversation

shellixyz
Copy link
Collaborator

@shellixyz shellixyz commented May 28, 2018

Inspired by Arduplane STAB_PITCH_DOWN setting.

The fw_min_throttle_down_pitch (decidegrees) controls the amount of down pitch to add in ANGLE mode mode when at low throttle. No down trim is added when throttle is above nav_fw_cruise_thr. Below nav_fw_cruise_thr downtrim is added in proportion to the amount the throttle is below nav_fw_cruise_thr. At zero throttle the full down pitch specified in this parameter is added. This parameter is meant to help keep airspeed up when flying in ANGLE mode with low throttle, such as when on a landing approach, without relying on an airspeed sensor.

Tested, ready to merge.

@shellixyz shellixyz force-pushed the auto_pitch_down_when_throttle_bellow_cruise branch from 542c81e to ba3839a Compare May 29, 2018 00:48
@shellixyz shellixyz force-pushed the auto_pitch_down_when_throttle_bellow_cruise branch from ba3839a to f97c97e Compare May 30, 2018 00:31

// Automatically pitch down if the throttle is reduced bellow cruise throttle
if ((axis == FD_PITCH) && STATE(FIXED_WING) && FLIGHT_MODE(ANGLE_MODE))
angleTarget += scaleRange(MAX(0, navConfig()->fw.cruise_throttle - rcCommand[THROTTLE]), 0, navConfig()->fw.cruise_throttle - PWM_RANGE_MIN, 0, mixerConfig()->fwMinThrottleDownPitchAngle);
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should move cruise_throttle from navConfig to something more generic since we're now using it outside navigation system?


// Automatically pitch down if the throttle is manually controlled and reduced bellow cruise throttle
if ((axis == FD_PITCH) && STATE(FIXED_WING) && FLIGHT_MODE(ANGLE_MODE) && !navigationIsControllingThrottle())
angleTarget += scaleRange(MAX(0, navConfig()->fw.cruise_throttle - rcCommand[THROTTLE]), 0, navConfig()->fw.cruise_throttle - PWM_RANGE_MIN, 0, mixerConfig()->fwMinThrottleDownPitchAngle);
Copy link
Member

Choose a reason for hiding this comment

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

I think we should start thinking about unifying configuration for navigation and other things into "platform configuration". We can have separate airplaneConfig and rotorcraftConfig plus unified platformConfig to keep common values. These structures will hold platform capabilities like max inclination, cruise throttle, hover throttle, reference airspeed etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍

Copy link
Member

Choose a reason for hiding this comment

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

It's definitely out of scope of current PR, but we should really look into it.

@DzikuVx
Copy link
Member

DzikuVx commented May 31, 2018

@shellixyz please document it somehow!

@shellixyz
Copy link
Collaborator Author

I added an explanation in the PR description for the moment. I will document it in the wiki when released.

@fiam fiam merged commit 512039a into iNavFlight:development Jun 18, 2018
@fiam fiam added this to the 2.0 milestone Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants