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

VTOL: fix roll inversion #11382

Merged
merged 3 commits into from
Mar 15, 2019
Merged

VTOL: fix roll inversion #11382

merged 3 commits into from
Mar 15, 2019

Conversation

jlecoeur
Copy link
Contributor

@jlecoeur jlecoeur commented Feb 5, 2019

fixes #4797

Describe problem solved by the proposed pull request
The VTOL attitude controller generates reversed fixed-wing roll commands. As a consequence, all VTOL mixers currently have a minus sign on roll actuators to compensate.

Describe your preferred solution

  • Fix sign of the fixed wing commands generated by the VTOL attitude controller
  • Fix builtin mixers
  • Add a parameter to force users of custom VTOL mixers to check roll control surfaces before flight
  • Fix builtin airframes scripts to bypass the new parameter

Flight testing
This requires extensive flight testing on all possible VTOL platforms.

Test card 1:

  • Flash firmware on VTOL
  • Before flight: Check direction of roll control surfaces
  • Fly standard mission, the behaviour should be unchanged

Test card 2:

  • set parameter V19_VT_ROLLDIR to 1
  • try to arm
  • the system should not generate actuator commands, error messages should be displayed on QGC.
  • set parameter V19_VT_ROLLDIR to 0
  • arm properly

@jlecoeur
Copy link
Contributor Author

jlecoeur commented Feb 5, 2019

I see spurious jenkins errors like

[21/667] Copying NuttX/nuttx to build/px4_fmu-v2_default/NuttX
FAILED: NuttX/nuttx_copy.stamp 
cd /tmp/jenkins/workspace/e-compile_pr-vtol_roll_inversion && cp -aRfl platforms/nuttx/NuttX/nuttx build/px4_fmu-v2_default/NuttX && cmake -E touch /tmp/jenkins/workspace/e-compile_pr-vtol_roll_inversion/build/px4_fmu-v2_default/NuttX/nuttx_copy.stamp
cp: cannot stat 'platforms/nuttx/NuttX/nuttx/wireless/bluetooth/bt_smp.h': No such file or directory
ninja: build stopped: subcommand failed.
Makefile:171: recipe for target 'px4_fmu-v2_default' failed
make: *** [px4_fmu-v2_default] Error 1
script returned exit code 2

@dagar
Copy link
Member

dagar commented Feb 5, 2019

I see spurious jenkins errors like

Should be fixed in master, try rebasing. It was a race condition with the submodules.

@jlecoeur jlecoeur force-pushed the pr-vtol_roll_inversion branch from cf7289a to 9e36b57 Compare February 5, 2019 20:39
@jlecoeur
Copy link
Contributor Author

jlecoeur commented Feb 5, 2019

I rebased and CI now passes, thanks @dagar

@jlecoeur jlecoeur force-pushed the pr-vtol_roll_inversion branch 2 times, most recently from 33ddc8b to c2929d1 Compare February 6, 2019 14:09
@dagar
Copy link
Member

dagar commented Feb 11, 2019

So far looks good. Let's get organized to test everything exhaustively.

@dagar dagar requested a review from a team February 11, 2019 01:54
@jlecoeur
Copy link
Contributor Author

@TestFlight this PR only affects VTOLs in fixed wing mode. Please test on all the VTOL platforms you have, see the test cards in my message above. Watch out before Take-Off, look out for a potential roll inversion when in fixed wing mode. There should be no difference with master.

@dagar dagar force-pushed the pr-vtol_roll_inversion branch from c2929d1 to c324754 Compare February 11, 2019 14:40
@jlecoeur
Copy link
Contributor Author

@Tony3dr any update on the flight tests?

@Tony3dr
Copy link

Tony3dr commented Feb 26, 2019

@Tony3dr any update on the flight tests?

Sorry for the delay, we are expecting replacement frames for the VTOL we have. We should get the replacements this week.

@jlecoeur
Copy link
Contributor Author

Great!

@Junkim3DR
Copy link

@jlecoeur we were unable to download the firmware from Jenkins.
"Compile All Boards — The build of this commit was aborted"

This inversion matches the fixed sign in the commands generated
by the VTOL attitude controller.
This commit, combined with the previous commit, should have no effect.
For safety, it is recommended to check the direction of roll control
surfaces before flight.
Mark V19_VT_ROLLDIR @category system

Throttle down mavlink critical msg

Send 0 actuator_output for safety

VTOL: unset v1.9 roll direction safety check param for builtin airframes
@jlecoeur jlecoeur force-pushed the pr-vtol_roll_inversion branch from c324754 to b7d0b45 Compare March 12, 2019 18:23
@jlecoeur
Copy link
Contributor Author

@Junkim3DR it should be good now

@dannyfpv
Copy link

dannyfpv commented Mar 13, 2019

Tested on pixhawk4 mini v5 Convergence frame
The flight went well overall, good transition to plane mode. No noticeable issues. Unfortunately, we got strong winds and the vehicle started drifting so we stopped flying the Convergence, light weight frame.
https://review.px4.io/plot_app?log=da0a2356-eb30-4b77-8deb-696798a263ba

@dagar
Copy link
Member

dagar commented Mar 15, 2019

Thank you for finally addressing this @jlecoeur

@dagar dagar merged commit 5f06c6a into master Mar 15, 2019
@dagar dagar deleted the pr-vtol_roll_inversion branch March 15, 2019 04:48
@dagar dagar mentioned this pull request Mar 15, 2019
@dagar
Copy link
Member

dagar commented Mar 15, 2019

Follow up issue #11650.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check roll direction for VTOL
5 participants