PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.48k stars 13.51k forks source link

Tailsitter mixer is broken (in gazebo) #8213

Closed imcnanie closed 6 years ago

imcnanie commented 7 years ago

Bug Report

Hello. The tailsitter model appears to be broken. Can anyone reproduce it for me? I'm running PX4 Master.

Take off works great, no issue there. Transition appears functional too. But in plane mode the vehicle quickly becomes unstable.

dagar commented 7 years ago

I'm aware of this, but haven't had time to fix it. Can you share a log? https://logs.px4.io/

After the v1.7.0 release there's going to be a big push for significantly more automated testing. It would be great to get this working again with testing so we can keep it working.

imcnanie commented 7 years ago

Here you go: https://logs.px4.io/plot_app?log=cf794d8f-59b5-476b-8143-00612c6d7ba4

whack path

What do you think the issue is. I messed around with the mixer for a while, it didn't seem like roll control was working, and the pitch "virtual elevator" was reversed.

Also, why do we have a virtual elevator?

RomanBapst commented 7 years ago

Hi @imcnanie I gave the tailsitter config a try in master and could not even do a takeoff, because it would complain of not having a position lock yet. If you have time can you try the following steps:

1) Use this mixer

Mixer for Tailsitter with x motor configuration and elevons
===========================================================

This file defines a single mixer for tailsitter with motors in X configuration.  All controls
are mixed 100%.

R: 4x 10000 10000 10000 0

Z:

# left elevon
M: 1
O:      10000  10000      0 -10000  10000
S: 1 0  10000  10000      0 -10000  10000

# right elevon
M: 1
O:       10000   10000    0 -10000  10000
S: 1 0   -10000   -10000    0 -10000  10000

# mixer for the virtual elevator
M: 1
O:       10000   10000   0 -10000  10000
S: 1 1   10000   10000    0 -10000  10000

2) Add this line to the elevator plugin here https://github.com/PX4/sitl_gazebo/blob/b052c97f7c3a2c39ab8ec06ae79c66431f16c659/models/tailsitter/tailsitter.sdf#L532

<control_joint_rad_to_cl>-4.0</control_joint_rad_to_cl>

Regarding your question about why the virtual elevator is needed: The liftdrag plugin does not model any aerodynamic moments (Cm = 0 all the time). So you cannot use elevons on the wings to create a pitching moments. That's why we introduced a virtual elevator which takes care of that.

Let me know how it goes, it would be nice to have at least a functional model of the tailsitter.

imcnanie commented 7 years ago

After that, it is still uncontrollable. For me I get the position lock issue with all the SITL models, I just have to wait a bit until it gets a home position.

Are you saying that the gazebo 0.0 tags don't work?

imcnanie commented 7 years ago

Haha check out the gazebo liftdrag plugin! https://bitbucket.org/osrf/gazebo/src/f8f238d19f916106008e5e287b584dcc46ba7297/plugins/LiftDragPlugin.cc?at=default&fileviewer=file-view-default#LiftDragPlugin.cc-342

RomanBapst commented 7 years ago

@imcnanie That's what I told you ;-)

PX4BuildBot commented 6 years ago

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 30 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)