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 Weathervane functionality - cleaned #9830

Closed
wants to merge 1 commit into from

Conversation

ivodre
Copy link
Contributor

@ivodre ivodre commented Jul 3, 2018

vtol_att_control

Orients the VTOL aircraft with the nose facing the wind.

This is done by using the (nonzero) roll setpoint necessary to stay on a fixed position to determine in which direction to turn in order to turn nose to wind. When nose is against wind only pitch/pusher will be necessary for staying in one position.

Signed-off-by: Ivo Drescher ivo.drescher@gmail.com

@RomanBapst @dagar

@dagar
Copy link
Member

dagar commented Jul 4, 2018

@sanderux FYI

@LorenzMeier
Copy link
Member

@ivodre Could you please rebase on master?

@LorenzMeier
Copy link
Member

@RomanBapst Where is this standing?

@RomanBapst
Copy link
Contributor

@LorenzMeier We are going to fly it today.

vtol_att_control

Orients the VTOL aircraft with the nose facing the wind.

This is done by using the (nonzero) roll setpoint necessary to stay on a fixed position to determine in which direction to turn in order to turn nose to wind. When nose is against wind only pitch/pusher will be necessary for staying in one position.

Signed-off-by: Ivo Drescher <ivo.drescher@gmail.com>
@ivodre ivodre force-pushed the weathervane_clean branch from 2b0299d to a3b1f12 Compare July 26, 2018 11:56
@ivodre
Copy link
Contributor Author

ivodre commented Jul 26, 2018

@LorenzMeier Rebase done. @roman I hope the flight tests go well!

@RomanBapst
Copy link
Contributor

RomanBapst commented Aug 6, 2018

@ivodre I finally got a little bit of wind on Friday and tested this on the convergence vtol. There wasn't really a lot of wind but I thought it might have been enough to see the algorithm working. Looking at the log I assume I need to increase the gain of the algorithm and possibly also tune the yaw rate loop of the convergence better. I do see the commanded yaw_sp_move_rate but it's not tracked well (no the problem of the weather-vane algorithm)

Here's the log file:
https://logs.px4.io/plot_app?log=4b0885f3-31ff-42b9-8fa1-9ef26b08c501

I basically hovered the entire time in position control at one spot. Since there was not too much wind I pulled one side of the wing during the last phase of the flight to simulate stronger wind.

@ivodre
Copy link
Contributor Author

ivodre commented Aug 6, 2018

@RomanBapst I fully agree. It looks like even as you had a roll angle of 20 degrees towards the end, the yaw_sp_move_rate did not go over 10 deg/s. I would increase the gain (maybe double it first, but it could be that the proper gain is 5 times higher than the current one).

Without wind, we also tested the algorithm by commanding a sideways movement. Let's say you command it to fly to the left. The result of commanding a left movement should be that while the aircraft first rolls to the left to achieve that movement it also starts rotating (yawing) to the left. You can use this to tune the gain until there is a reasonable yawing toward the direction you are heading to.

@LorenzMeier
Copy link
Member

@ivodre Where are you standing with testing this? We would love get this validated, tuned and merged. Where is your own testing standing?

@ivodre
Copy link
Contributor Author

ivodre commented Aug 27, 2018

@LorenzMeier I am using this functionality already and saw it working well also in relatively strong wind. What would you guys need in terms of validation and tuning? Do you have feedback?

One thing we might want to discuss is the behavior of the drone when
a) Switching between position control (weathervane active) and altitude control/stabilized (weathervane not active).
b) Transitioning

What is happening right now:
a) In position control weathervaning is active and the drone yaws in direction of the wind or in the direction where we command it to fly (so basically in the direction the air is coming from). When switching to altitude control than the drone turns until it reaches the heading it had before it switched to position control (which is the original heading it had without weathervaning).
b) The drone transitions into the direction it was heading to prior to turning on weathervaning (which is the same as turning weathervaning off by changing to altitude control and than starting the transition).

The current behavior has the advantage that the transition direction does not depend on where the wind is coming form and can therefore be predicted. The disadvantage might be that the vehicle is turning away from its optimal heading towards the wind when we switch to altitude control (I never experienced issues/instabilities due to that though).

@RomanBapst
Copy link
Contributor

@ivodre We finally had strong wind yesterday and were able to test this. I have to say it works quite well!
As you suggested we should still discuss some aspects of the yawing behavior. Here are two additional things I noticed:

  1. I had zero yaw control during position control. I'm not quite sure what to make of that. On one hand I feel like I should have control on the other hand the drone actually turns into the wind which is the best idea.

  2. When the drone is weathervaning you lose the meaning of roll and pitch as a pilot. Depending on the yaw angle the drone will react differently to roll and pitch commands. I can help look into that since I think I know what the issue is.

Here is the log file:
https://review.px4.io/plot_app?log=83c6340a-fda0-4ecc-a47e-69387cb10870

@LorenzMeier
Copy link
Member

@RomanBapst Great testing! What is the timeline to get this rebased & merged with the additional fixes you suggested?

@dagar
Copy link
Member

dagar commented Aug 30, 2018

This might be a terrible idea, but we could consider trying the "Simple" style relative control with manual position mode plus weathervaning active.

@dagar
Copy link
Member

dagar commented Aug 30, 2018

  1. When the drone is weathervaning you lose the meaning of roll and pitch as a pilot. Depending on the yaw angle the drone will react differently to roll and pitch commands. I can help look into that since I think I know what the issue is.

@RomanBapst I believe it's the yaw setpoint in the position controller. It either needs to be made aware of weathervaning, or kept constrained. Take a look at the thrust -> attitude helper.

@ivodre
Copy link
Contributor Author

ivodre commented Aug 31, 2018

This might be a terrible idea, but we could consider trying the "Simple" style relative control with manual position mode plus weathervaning active.

@dagar Are you suggesting to superpose a manually controlled yaw rate over the yaw rate commanded by the weathervaning function (if the manual yaw command is 0 than it's just the weathervaning, otherwise a combination of weathervaning and manual yaw rate (which can be stronger than the yaw rate form weathervaning))?

@ivodre
Copy link
Contributor Author

ivodre commented Aug 31, 2018

When the drone is weathervaning you lose the meaning of roll and pitch as a pilot. Depending on the yaw angle the drone will react differently to roll and pitch commands. I can help look into that since I think I know what the issue is.

@RomanBapst I believe it's the yaw setpoint in the position controller. It either needs to be made aware of weathervaning, or kept constrained. Take a look at the thrust -> attitude helper.

@RomanBapst @dagar
Maybe we could just set the yaw setpoint in the position controller to the current yaw angle. Than roll/pitch would behave as usual and the transition direction could be controlled by rolling until the drone points into the direction I want to transition (is this correct?).

We could introduce an option to select what steering mode we want to use when weathervaning is active (or allow the user to switch between two "types" of weathervaning.

If you guys want I could join the dev call next Wednesday to discuss this.

@RomanBapst
Copy link
Contributor

@ivodre @dagar Having manual yaw rate control on top of weathervane actually does not sound too bad. Basically if you have no wind at all it could be annoying if you cannot yaw because there is no specific heading that makes sense.
And yes, I think we should make the position controller aware of the weathervaning. Resetting the yaw setpoint in weathervane mode does not sound like a too bad idea actually.
I'll be working on this next week so let me come up with a proposal and then you can review it and possibly discuss it during our next dev call?
@LorenzMeier The plan is to bring this in next week!

@stale
Copy link

stale bot commented Jan 20, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Feb 4, 2019

Closing as stale.

@stale stale bot closed this Feb 4, 2019
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.

4 participants