angle[PITCH] vs angle[ROLL]

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
happul3
Posts: 44
Joined: Mon Apr 21, 2014 1:54 am

angle[PITCH] vs angle[ROLL]

Post by happul3 »

There is an interesting asymmetry between angle[ROLL] and angle[PITCH] calculations. The former one is fairly straightforward, using two elements (z and x) of estimated gravity vector. But the latter is more complicated, and I am baffled as to why. It costs tens of microseconds to produce square root of z^2 + y^2 to make angle[ROLL] dependent on angle[PITCH] for some reason.

Consider this example: holding multicopter in hands (unarmed, of course) roll it to 45 degrees then start pitching it until copter is perpendicular to the ground. I'd expect that calculated roll remains at 45 and calculated pitch increases, but in reality the calculated roll increases to as much as 90 degrees. Personally, I do not fly aggressively enough that these non-obvious responses would make difference, but I still wonder why it is done like that. Anyone can shed light on this?

Post Reply