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

Add position lock to resolve quadcopter sinking in offboard mode #12206

Closed
shrit opened this issue Jun 7, 2019 · 22 comments
Closed

Add position lock to resolve quadcopter sinking in offboard mode #12206

shrit opened this issue Jun 7, 2019 · 22 comments

Comments

@shrit
Copy link

shrit commented Jun 7, 2019

Describe the bug
I have noticed that the IRIS quadcopter have tendency to lose altitude in gazebo when pitching or rolling in some direction. The problem have been reported and well discussed
on Slack you can follow using this thread:
https://px4.slack.com/archives/C68J8H32A/p1559816218007600

Log Files and Screenshots
https://logs.px4.io/plot_app?log=97830f7e-5bce-4649-8704-e5d0ffc8ea5b

@julianoes
Copy link
Contributor

Since (free) Slack deletes all conversation after some time, let me give some more context to this.

This is using velocity offboard control in MAVSDK. The problem is that the drone will try to hold the z velocity but does not correct drift over time.

A possible fix would be to lock the z position if z velocity is set to 0.

I had done something like that a while ago before position control received flight tasks:
642e65c

@MaEtUgR
Copy link
Member

MaEtUgR commented Jun 7, 2019

I'm shifting towards having reusable logic of the flight tasks in libraries anyways and we can just reuse the position lock from manual position mode which locks the altitude/position when the velocity is constantly zero. The start for this library can be found here: https://github.com/PX4/Firmware/pull/12072/files#diff-cd11905871652d5f1467db1dfc9cecd2R47

@dakejahl
Copy link
Contributor

dakejahl commented Jun 9, 2019

Nice! Can we have this perform braking? It would be ideal if <0,0,0> velocity setpoints caused the vehicle to brake and then lock into a position hold after coming to a stop.

I am imagining the aggressiveness of the braking could be controlled via a parameter.

@shrit
Copy link
Author

shrit commented Jul 17, 2019

Just to add some more details: After monitoring several flights of the quadcopter. I have noticed that sometimes the quadcopter do not just sink, but gain some altitude. For example: a quadcopter might gain up to 5 meters up when it is going forward, and then it starts to sink gradually.

@stale
Copy link

stale bot commented Oct 15, 2019

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale label Oct 15, 2019
@julianoes julianoes added the Mode: Offboard Offboard mode control label Oct 17, 2019
@stale stale bot removed the stale label Oct 17, 2019
@stale
Copy link

stale bot commented Jan 15, 2020

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale label Jan 15, 2020
@shrit
Copy link
Author

shrit commented Jan 15, 2020

Keep open

@stale stale bot removed the stale label Jan 15, 2020
@stale
Copy link

stale bot commented Apr 14, 2020

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale label Apr 14, 2020
@shrit
Copy link
Author

shrit commented Apr 14, 2020

Keep open

@stale stale bot removed the stale label Apr 14, 2020
@Pedro-Roque
Copy link
Member

@MaEtUgR is this still ongoing?

@shrit
Copy link
Author

shrit commented May 2, 2020

@Pedro-Roque Yes, it still open.

@stale
Copy link

stale bot commented Aug 1, 2020

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale label Aug 1, 2020
@shrit
Copy link
Author

shrit commented Aug 1, 2020

Keep open

@stale stale bot removed the stale label Aug 1, 2020
@Jaeyoung-Lim
Copy link
Member

@shrit Why would you use attitude setpoints if you want to control the attitude? Why is using velocity setpoints / position setpoints not an option?

@shrit
Copy link
Author

shrit commented Aug 1, 2020

@Jaeyoung-Lim I use only velocity setpoints. In this case, I was using the velocity setpoints to set the velocity of quadrotor every 50 milliseconds (In order to simulate the behavior of a joystick for example)

@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale label Dec 25, 2020
@shrit
Copy link
Author

shrit commented Jun 7, 2021

Keep open

@stale stale bot removed the stale label Jun 7, 2021
@Jaeyoung-Lim
Copy link
Member

Jaeyoung-Lim commented Oct 25, 2021

@shrit Given that offboard mode is simply a way to directly access the cascaded controllers inside the fmu, I still think there should be a position controller that is outside compensating for the drift, rather than the expecting the flight controller to hold position when velocity 0 is commanded.

@Pedro-Roque
Copy link
Member

I agree with @Jaeyoung-Lim . A zero velocity control command will inherently drift.

@shrit
Copy link
Author

shrit commented Oct 26, 2021

@Pedro-Roque @Jaeyoung-Lim I agree on the point that if the velocity vector is equal zero, then the drone is going to drift.
However, the behavior I observed when I open this issue is related to the sinking of the quadrotors toward the ground rather than drifting. The quad tends to sink when moving forward in this manner and does not compensate the Z component over time.

@Jaeyoung-Lim
Copy link
Member

Jaeyoung-Lim commented Oct 26, 2021

@shrit This is related to the vertical velocity not being well observable/controlled compared to the horizontal velocity components. I believe it is safe to say that what you are seeing is drift of the velocity controller and you will see different extent of drifts depending on the vehicle dynamics for each axis.

You can try to fight this issue with having a tighter velocity controller on the fmu side. But I don't think having additional position control to lock the altitude is the right solution for this issue. If you have a outer feedback loop compensating for this effect I believe this will disappear.

@shrit
Copy link
Author

shrit commented Oct 26, 2021

Okay, in this case, if I observe the issue I will add an outer feedback look to compensate.
You can close this issue if there is nothing to add on the firmware side.

Multicopter automation moved this from To do to Done Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Multicopter
  
Done
Development

No branches or pull requests

6 participants