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: Quadplane flight modes pitch trim #8175

Merged
merged 4 commits into from
Nov 12, 2018

Conversation

IamPete1
Copy link
Member

Add independent trim functionality when in Quadplane flight modes

Introduced Q_AHRS_TRIM_X, Q_ AHRS_TRIM_Y and Q_AHRS_TRIM_Z these allow quadplane view to be rotated with respect to forward flight view. Quadplanes can then be trimed for forward flight in the usual way, and also trimed sperarly for vertical flight.

Trim is in radians to match overall trim, trim is relative to forward flight trim, requires reboot to take effect.

I'm abit of a C++ noob so not sure if this is the most efficient method of doing this, does work tested on PH1

@OXINARF OXINARF requested a review from tridge May 23, 2018 16:48
@IamPete1 IamPete1 force-pushed the Quadplane-add-trim branch 2 times, most recently from 23d247d to 55136f7 Compare September 25, 2018 15:51
@IamPete1 IamPete1 changed the title Quadplane flight modes AHRS trim Plane: Quadplane flight modes pitch trim Oct 6, 2018
@IamPete1
Copy link
Member Author

IamPete1 commented Oct 6, 2018

I have changed this such that it is only pitch trim as discussed in the dev call.

I attempted to make it update on the calibrate level command as for forward flight, I couldn't get it to work in the end. I added

if (!quadplane.in_vtol_mode()) { // trim forward flight ahrs.set_trim(Vector3f(trim_roll, trim_pitch, 0)); } else { // trim vtol pitch quadplane.quadplane_ahrs_trim_pitch.set_and_save(trim_pitch); }

to Plane::accel_cal_update()

but no luck, it wasn't even not updating the the forward flight trim in Q modes, not to sure why this is.

@tridge
Copy link
Contributor

tridge commented Nov 12, 2018

I've rebased on master and done some small cleanups on this. When this passes CI I think it's ready to go in. Thanks Peter!

always pass the pitch trim, and removed unusued variables
improved documentation and variable names
@tridge tridge merged commit c59b2c1 into ArduPilot:master Nov 12, 2018
@IamPete1 IamPete1 deleted the Quadplane-add-trim branch November 5, 2019 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Plane Backports
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

4 participants