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

Projects
None yet
4 participants
@shellixyz
Copy link
Collaborator

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 shellixyz:auto_pitch_down_when_throttle_bellow_cruise branch from 542c81e to ba3839a May 29, 2018

@shellixyz shellixyz force-pushed the shellixyz:auto_pitch_down_when_throttle_bellow_cruise branch from ba3839a to f97c97e May 30, 2018


// 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);

This comment has been minimized.

Copy link
@digitalentity

digitalentity May 30, 2018

Member

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);

This comment has been minimized.

Copy link
@digitalentity

digitalentity May 30, 2018

Member

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.

This comment has been minimized.

Copy link
@shellixyz

shellixyz May 31, 2018

Author Collaborator

👍

This comment has been minimized.

Copy link
@digitalentity

digitalentity May 31, 2018

Member

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

@DzikuVx

This comment has been minimized.

Copy link
Member

commented May 31, 2018

@shellixyz please document it somehow!

@shellixyz

This comment has been minimized.

Copy link
Collaborator Author

commented May 31, 2018

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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@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
You can’t perform that action at this time.