Plane: Add trim pitch to minimum takeoff pitch #28669
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have a report here that a small flying wing (a ZOHD) failed to climb to altitude during an AUTO takeoff.
The issue was that this plane does not climb when it's at full throttle and ~0deg pitch. Hence when the code for tapering off the pitch setpoint in the last few meters of the climb kicked in, the plane settled at around 3m below the target altitude, unable to climb more.
This PR applies
PTCH_TRIM_DEG
to the result ofget_takeoff_pitch_min_cd()
, so that it is in par with the result ofcalc_nav_pitch()
.Reminder, the result of
get_takeoff_pitch_min_cd()
is directly written as a pitch setpoint when there is no airspeed sensor or whenTKOFF_OPTIONS[0]=0
;PTCH_TRIM_DEG
is never employed currently in this case.I'm not 100% convinced that this will solve the problem effectively. The alternative is to write sort of an integrating term controller to monitor this steady-state error and wind the pitch setpoint back up. But I don't want to make this so complex.
The reason we didn't have this problem in 4.5 is that the code was bugged and the demanded pitch would always be the takeoff pitch, no taper.