Gyros- Gimbal Lock

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

Gyros- Gimbal Lock

Post by RCvertt »

Does MultiWii still have gyro gimbal lock? I think Timecop said that his code doesn't have it so I was wondering if a lighter version that the 328p can handle has filtered into the Arduino based code yet or if it's even possible?

I would like to use the Accel to automatically detect if my tail sitter plane has pitched 90 degrees, so that it knows when it is flying forward or taking off vertically but I can't do that with gimbal lock present.

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Gyros- Gimbal Lock

Post by timecop »

Of course it still has gimbal lock, as long as your calculation isn't in quaternions.
I didnt touch control/attitude code from mwc, so same problems exist.
Also for some insane reason mwc code does pitch in -180+180 range where everything else sane does -90+90.
I'm sure patches to fix this would be very welcome.

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

Re: Gyros- Gimbal Lock

Post by RCvertt »

Thanks for the reply. Wasn't sure if quaternions had been implimented yet or not.

I think it will allow for some cool now features and projects when it goes away. Hopefully someone can replace the Euler calculations for us.

JBear
Posts: 1
Joined: Sat Oct 13, 2012 8:52 am

Re: Gyros- Gimbal Lock

Post by JBear »

There is an open source IMU algorithm using quartenions available that has been used for Multirotors (in the stalled project Pipo by Erez Raviv). According to the report the sensor fusion algorithm is slightly better than a Kalman filter implementation and the use of quartenions prevent gimbal lock. The C-code implementation of the filter is provided and as it was used in the Pipo, even an Atmega328 managed to calculate it all without bogging down.

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

Re: Gyros- Gimbal Lock

Post by RCvertt »

JBear wrote:There is an open source IMU algorithm using quartenions available that has been used for Multirotors...
Very nice. So did anyone every get around to implementing this for multiwii 2.1 or 2.2? This stuff is way over my head to implement or I would gladly have done it.

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Gyros- Gimbal Lock

Post by timecop »

You don't want this calculation on 8bit/16mhz platform.

brm
Posts: 287
Joined: Mon Jun 25, 2012 12:00 pm

Re: Gyros- Gimbal Lock

Post by brm »

nada - tc, you are WRONG!
seb's code on a stupid 8 bitter makes sense.

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Gyros- Gimbal Lock

Post by Alexinparis »

If you use v2.2 + a 9DOF sensor, there is no more gimbal lock problem.
The angle calculation changed.
You can see it in the java GUI model representation.
I think the algo is way faster than any quaternion approach.

Post Reply