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

Controller mellinger yaw direction reversed #335

Closed
kyuhyong opened this issue Jun 19, 2018 · 3 comments
Closed

Controller mellinger yaw direction reversed #335

kyuhyong opened this issue Jun 19, 2018 · 3 comments
Milestone

Comments

@kyuhyong
Copy link

I tried to compare using PID and Mellinger for controller and found their yaw direction is opposite.
In cfclient, right yaw commands gives positive deg/s while left yaw gives negative deg/s
with PID controller, cf2 turns right when I commanded right yaw however
with Mellinger controller, cf2 turns left for the same command.
Is this intentional?
I tried to modify some code in the mellinger.c but changing the input does not help solving this issue.
Thanks,

Kyu

@krichardsson
Copy link
Contributor

I think I'll pass this one on to @whoenig
Thanks!

@whoenig
Copy link
Contributor

whoenig commented Jun 20, 2018

This is not intentional and sounds like a bug to me. The mellinger controller was more heavily tested for operation in a mocap, so this might be related to the slightly separate manual flight mode. I'll take a look.

whoenig added a commit to USC-ACTLab/crazyflie-firmware that referenced this issue Jun 23, 2018
The PID and mellinger controllers had different behaviors (inverse
yaw direction) in manual flight mode, see issue bitcraze#335.  The root cause
is that the legacy yaw input is actually inverse (with respect to
the CF coordinate system). This change changes the sign accordingly
before processing and fixes some other math issues related
to yaw control.

Tested with manual flight using PID and Mellinger controllers.
@kyuhyong
Copy link
Author

I applied the fix and tested with my drone today.
It seems the issue is gone with both CONTROLLER: Using controller 2 or 1
Thanks,
Kyu

@krichardsson krichardsson added this to the next-version milestone Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants