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

Plane: Add trim pitch to minimum takeoff pitch #28669

Closed

Conversation

Georacer
Copy link
Contributor

@Georacer Georacer commented Nov 18, 2024

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 of get_takeoff_pitch_min_cd(), so that it is in par with the result of calc_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 when TKOFF_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.

This applies PTCH_TRIM_DEG to the result of get_takeoff_pitch_min_cd(), so
that it is in par with the result of calc_nav_pitch().
@Hwurzburg
Copy link
Collaborator

Hwurzburg commented Nov 18, 2024

Not sure I agree with this....PITCH_TRIM_DEG is to compensate for mounting such, that the resulting 0 pitch out of AHRS represents the "level" flight point.....so when desired pitch is X, and the vehicle is at that pitch, it will actually be at desired+pitch_trim_deg.... which should (after TECS trimming) be the level point in hands off FBWA at cruise trim throttle

except for AHRS output, code should not know anything about PITCH_TRIM_DEG....its an AHRS bias

@Georacer
Copy link
Contributor Author

Not sure I agree with this....PITCH_TRIM_DEG is to compensate for mounting such, that the resulting 0 pitch out of AHRS represents the "level" flight point.....so when desired pitch is X, and the vehicle is at that pitch, it will actually be at desired+pitch_trim_deg.... which should (after TECS trimming) be the level point in hands off FBWA at cruise trim throttle

except for AHRS output, code should not know anything about PITCH_TRIM_DEG....its an AHRS bias

Not quite. AHRS_TRIM_* is for compensating AHRS readings for mounting inaccuracies.

The description of PTCH_TRIM_DEG reads:

Offset in degrees used for in-flight pitch trimming for level flight. Correct ground leveling is an alternative to changing this parameter.

It is the degrees of pitch-up you need to fly level at cruise airspeed and it is indeed been added in already by the calc_nav_pitch().

@Georacer
Copy link
Contributor Author

I retract my comment and my PR. You're right @Hwurzburg , in another way.

PTCH_TRIM_DEG is applied onto both the result of calc_nav_pitch() and of get_takeoff_pitch_min_cd(). This happens a bit later down at stabilize_pitch_get_pitch_out().

So what I'm doing here is double-dipping on PTCH_TRIM_DEG. I guess I'll have to write an integrator or something after all.

@Georacer Georacer closed this Nov 18, 2024
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.

2 participants