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 tiltrotor tilt ("pusher") support in hover #13779

Merged
merged 5 commits into from
Feb 7, 2020

Conversation

sfuhrer
Copy link
Contributor

@sfuhrer sfuhrer commented Dec 24, 2019

Describe problem solved by this pull request
This PR enables the controller for tiltrotor VTOL to use tilting of the motors to accelerate forward (similar as the standard VTOL can use its pusher/pull motor to do so).

Test data / coverage
Initial testing looked promising, but need to do some more as I've changed the thrust compensation when tilting is applied.
Also needs to be tested on a standard VTOL to check for regressions.

This a video of the first flight: https://drive.google.com/file/d/1gHhwEUxHKgazkDOrzRixyPfx4gMYRJ-x/view?usp=sharing
It was with flying in altitude mode (I've enabled pusher/tilt assist also in altitude mode to test this PR - do you think it's a good idea to enable that in general @RomanBapst ?).

@sfuhrer sfuhrer added the Hybrid VTOL 🛩️🚁 Multirotor + Fixedwing! label Dec 24, 2019
@sfuhrer sfuhrer requested a review from RomanBapst December 24, 2019 10:25
@sfuhrer sfuhrer self-assigned this Dec 24, 2019
@sfuhrer sfuhrer force-pushed the pr-VTOL_tiltrotor_pusher_support branch from fee7b38 to 4326152 Compare December 30, 2019 12:43
@sfuhrer
Copy link
Contributor Author

sfuhrer commented Dec 30, 2019

Did some flight testing on a tiltrotor:
https://review.px4.io/plot_app?log=acdf11e2-7fe3-4017-94a7-1e0f1ac634d6

and standard VTOL:
https://review.px4.io/plot_app?log=8bd834a3-7423-4458-b197-083dc1af809a

Both flights were done mainly in altitude mode, where I've for testing purposes also enabled the pusher/tilt support in hover. I've removed that for this PR, and think about another one where I want to enable pusher/tilt support in other flight modes (altitude, stabilized, landing,..) (probably controllable per parameter).

@sfuhrer sfuhrer force-pushed the pr-VTOL_tiltrotor_pusher_support branch from 3ef3d07 to ac35d52 Compare December 30, 2019 12:59
@sfuhrer sfuhrer marked this pull request as ready for review December 30, 2019 13:29
@sfuhrer sfuhrer force-pushed the pr-VTOL_tiltrotor_pusher_support branch from ac35d52 to c109985 Compare January 15, 2020 08:23
// normalized pusher throttle (standard VTOL) or tilt (tiltrotor), initialize to 0
_hover_pusher_or_tilt_forward_actuation = 0.0f;

// if the thrust scale param is zero or the drone is on manual mode,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sfuhrer The comment does not match reality I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to "not in position or altitude control mode", and thus also change the logic to enable it in altitude control mode.

@RomanBapst
Copy link
Contributor

@sfuhrer Let's discuss this during our call today.

@sfuhrer sfuhrer force-pushed the pr-VTOL_tiltrotor_pusher_support branch 2 times, most recently from 0bccd3f to 2636c57 Compare January 29, 2020 12:43
-move pusher assist functionality into vtol_type class and adapt it to also
work for tiltrotor VTOLs (pitch rotors down to accelerate forward)
-for tiltrotor: compensate for lost lift due to tilt by increasing the throttle
-enable pusher / tiltassist also in altitude mode

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
@sfuhrer sfuhrer force-pushed the pr-VTOL_tiltrotor_pusher_support branch from 2636c57 to d663c84 Compare January 29, 2020 12:47
@codecov
Copy link

codecov bot commented Jan 29, 2020

Codecov Report

Merging #13779 into master will decrease coverage by 14.99%.
The diff coverage is 60.25%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #13779     +/-   ##
=========================================
- Coverage   51.05%   36.06%    -15%     
=========================================
  Files         617      548     -69     
  Lines       52660    47005   -5655     
=========================================
- Hits        26885    16951   -9934     
- Misses      25775    30054   +4279
Flag Coverage Δ
#mavsdk 36.06% <60.25%> (?)
#python ?
#sitl_mission_FW ?
#sitl_mission_MC_box ?
#sitl_mission_MC_offboard_att ?
#sitl_mission_MC_offboard_pos ?
#sitl_mission_Rover ?
#sitl_mission_VTOL_standard ?
#sitl_python_FW ?
#sitl_python_MC_box ?
#sitl_python_MC_offboard_att ?
#sitl_python_MC_offboard_pos ?
#sitl_python_Rover ?
#sitl_python_VTOL_standard ?
#sitl_python_VTOL_tailsitter ?
#unittest ?
Impacted Files Coverage Δ
src/modules/vtol_att_control/vtol_type.h 33.33% <ø> (ø) ⬆️
src/modules/vtol_att_control/tiltrotor.h 0% <ø> (ø) ⬆️
...c/modules/vtol_att_control/vtol_att_control_main.h 94.11% <ø> (ø) ⬆️
src/modules/uuv_att_control/uuv_att_control.hpp 0% <ø> (ø)
...modules/vtol_att_control/vtol_att_control_main.cpp 80.26% <ø> (+4.02%) ⬆️
src/modules/mavlink/mavlink_main.h 52.43% <ø> (ø) ⬆️
src/modules/vtol_att_control/standard.cpp 90.1% <ø> (+12.83%) ⬆️
src/modules/replay/ReplayEkf2.hpp 0% <ø> (ø) ⬆️
src/lib/drivers/gyroscope/PX4Gyroscope.hpp 100% <ø> (ø) ⬆️
src/modules/vtol_att_control/tiltrotor.cpp 0% <ø> (ø) ⬆️
... and 377 more

// desired roll angle in heading frame stays the same
float roll_new = -asinf(body_z_sp(1));

_forward_thrust = (sinf(-pitch_down) - sinf(_params->down_pitch_max)) * _params->forward_thrust_scale;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sfuhrer It's a bit problematic because it would change the tuning of existing vehicles, but thinking about it we should probably multiply this by the current demanded throttle. Otherwise the calculated forward thrust is only a function of the demanded pitch down command but in theory the demanded thrust could be very little.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah right..this would though mainly affect standard VTOL, right? As for tiltrotor the forward thrust actually is reduced together with the combined thrust (not in code, but indirectly as we from the VTOL module only give out a tilt angle, and not a thrust that's then correctly allocated).
It so far though never posed any problems, did it?

@RomanBapst
Copy link
Contributor

@sfuhrer Generally looks good, although I think we don't need to make _forward_thrust a class member. If we get rid of it I think the code even becomes more readable as it's more clear what these functions do.

 - remove gloabl variable and instead give back forward_thrust from function
 - give back increased vertical thrust from fct thrust_compensation_for_tilt()

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
RomanBapst
RomanBapst previously approved these changes Feb 6, 2020
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
RomanBapst
RomanBapst previously approved these changes Feb 7, 2020
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
@bkueng bkueng merged commit 9ba0d5b into master Feb 7, 2020
@bkueng bkueng deleted the pr-VTOL_tiltrotor_pusher_support branch February 7, 2020 15:43
@mrpollo mrpollo mentioned this pull request Mar 16, 2020
@OzanDurmaz
Copy link

Hi, can you also implement yaw vectoring with tilt rotor vtols?

@lydoraemon
Copy link

Hi, can you also implement yaw vectoring with tilt rotor vtols?

yaw is already controlled by tilt servo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hybrid VTOL 🛩️🚁 Multirotor + Fixedwing!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants