VTOL transition gimbal lock issue

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
fmb4
Posts: 3
Joined: Sun Jan 17, 2016 5:06 pm

VTOL transition gimbal lock issue

Post by fmb4 »

I a working on a tail sitter VTOL plane and I have the hover portion working well. It is a fairly typical looking flying wing with twin motors and big fins so that it can stand vertically for take-off. I can stabilize the hover and then I can tun off the stabilization in order to fly like an airplane. The problem I am running into is that once I am in airplane mode the multiwii seems to go into gimbal lock and it loses all orientation. Does anyone have any suggestions on how I can create a transition so that the gyro can maintain orientation in both vertical and horizontal modes? any suggestions are greatly appreciated!!

fmb4
Posts: 3
Joined: Sun Jan 17, 2016 5:06 pm

Re: VTOL transition gimbal lock issue

Post by fmb4 »

To give everyone some sense of what I am working on here is a youtube video of a flight demo I did at National Maker Faire in Washington DC.

https://www.youtube.com/watch?v=j1X2R1A05AI

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: VTOL transition gimbal lock issue

Post by Kbev5709 »

During your video you only show the plane in vertical mode, so that doesn't help much in seeing what happens/goes wrong when you go into horizontal flight. My suggestion,(it might sound stupid to you I know because this is not even normally the kind of question I would try to answer,) would be to try mounting your FC on a gimbal so it (the FC) stays level no matter what angle the plane is flying at. Use the cam stab pins to control the FC leveling gimbal (if you have that). That way there is no need to turn off stabilization. Try using a servo driven one. They are cheap and easy. Use more servos to move directional surfaces like a standard plane, which can all be controlled by the FC. That's how I would do what you are trying to do using my MW Pro2 FC. Just my 2 cents for what it's worth. :shock: :D

fmb4
Posts: 3
Joined: Sun Jan 17, 2016 5:06 pm

Re: VTOL transition gimbal lock issue

Post by fmb4 »

Thanks for the suggestion. I have considered that but it is essentially a hardware solution to a software problem so I would prefer to solve the problem in software. The issue is that the flight controller only maintains orientation for 90 degrees up and 90 degrees down. So if I fly the plane in normal airplane mode with the multiwii level everything is fine. If I pitch up everything is fine up until 90 degrees. If I go to 91 degrees or more the flight controller goes nuts and loses all orientation. At this point the plane will just tumble to the ground from the random inputs it gets from the multiwii. This condition is called gimbal lock and it comes from using Euler angles which I believe is what Multiwii uses. I am aware of solutions such as an EKF but as far as I know the 328 processor cant handle that. So right now I can fly in normal airplane mode and everything is great. I can also configure the controller to fly in VTOL mode which also works well as seen in the video. What I cant do is get the system to transition between the two modes without losing orientation.

mahomedia
Posts: 12
Joined: Tue Feb 05, 2013 10:59 pm

Re: VTOL transition gimbal lock issue

Post by mahomedia »

Hi.
Multiwii has a setup option for imu orientation. We set orientations by commenting or uncommenting lines. You need to update code to be able to change this hardcoded values in runtime. If you change imu orientation right moment during transition it should work. Turning imu 90 degrees around x axis for all calculations.(may be y axis I'm not sure).

RCvertt
Posts: 172
Joined: Fri Sep 14, 2012 11:45 am

Re: VTOL transition gimbal lock issue

Post by RCvertt »

fmb4 wrote:...Does anyone have any suggestions on how I can create a transition so that the gyro can maintain orientation in both vertical and horizontal modes? any suggestions are greatly appreciated!!
Easiest way is to not use gyros during horizontal flight because of the gimbal lock you mention. Use axisPid for hover commands and rcCommand for forward flight.

I wouldn't expect to see gimbal lock removed in our life time using MultiWii.

Post Reply