Roll & pitch 90 deg transition problem

Asked by Marcin J

Hi guys,

I'm back with small problem concerning transition through +-90 degree angle on roll and pitch.
Here is video illustrating my issue: http://youtu.be/8sw-GhuUXs8
Data acquired from accelerometer seem valid; axises have correct sign and range of values.
Magnetometer measurements are scaled due to its maximum readings along all axises.

Maybe it's worth mentioning, that I multiply all accelerometer readings axis by (-1) and invert final Euler pitch angle, to match real movements with pc visualisation.
To me, it looks like the algorithm cannot distinguish positive and negative values along some axis..
Any ideas why my IMU is behaving this way?

Cheers

Question information

Language:
English Edit question
Status:
Solved
For:
FreeIMU Edit question
Assignee:
No assignee Edit question
Solved by:
Fabio Varesano
Solved:
Last query:
Last reply:
Revision history for this message
Fabio Varesano (fabio-varesano) said :
#1

You shuold use the quaternion or Euler outputs from the FreeIMU library for doing that.. getYawPitchRoll is just something useful if you are interested in Yaw Pitch and Roll if you want to control a flying vehicle or something like that.

Revision history for this message
Marcin J (jimarcin) said :
#2

Thank you for your reply :-)

Swapping getYRP to Euler angles solved issue with roll angle but I still get this 180* flick when rotating along pitch
And yes, I want to control quadrocopter with that : )

Revision history for this message
Marcin J (jimarcin) said :
#3

Little additional comment: It's doing now 360 around X axis when rotating along pitch

I'm definitely more interested in previous setup (I mean gerYawRollPitch) because now when I turn yaw 90*, my roll becomes pitch (which I suppose is desired when using getEuler option)

Revision history for this message
Fabio Varesano (fabio-varesano) said :
#4

yeah.. Euler angles have problems (Gimbal locks)... you can use the YPR function for your application..

Revision history for this message
Marcin J (jimarcin) said :
#5

But is there any chance that I would get smooth transitions through this critical 90* angles, using YPR?

Revision history for this message
Best Fabio Varesano (fabio-varesano) said :
#6

I don't think so. That code has been written to stabilize a copter, not to make aerobatics. If this is your plan you should try to improve that code. I wouldn't suggest starting from the FreeIMU library then.. probably you'd better study MultiWii copter code since that's #1 choice for aerobatics in quadcopters.

Revision history for this message
Marcin J (jimarcin) said :
#7

Thanks Fabio Varesano, that solved my question.