cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

3D Rotation [Quaternion]

ptc-1368288
1-Newbie

3D Rotation [Quaternion]

This is the quaternion rotation. The note may not apply exactly, it comes from the TrigRot ... which I have removed to avoid confusion. The difference with "this" typical QuatRot and the traditional TrigRot is that the axis system is different. Otherwise, setup your quaternion vector to rotate. Accordingly to the literature, there is economy in the APOS [Arithmetic Operations]. This point is debatable, considering the real or not real need for the about 21 AOPS trig approximation for about 18 decimals or more exactly 16 machine precision decimals ... that in fact no aircraft need such angular accuracy !!!
But Philip insisted and made his point on AOPS reduction based QuatRot.
TrigRot metafile added.

jmG
9 REPLIES 9
PhilipOakley
5-Regular Member
(To:ptc-1368288)

On 4/29/2010 10:45:39 PM, jmG wrote:

... that in fact no
>aircraft need such angular
>accuracy !!!
>But Philip insisted and made
>his point on AOPS reduction
>based QuatRot.
>
>jmG

Jean,

The reason that the aircraft do rely on
quaternions is because they are computing the
compound action of the roll, pitch and yaw from
the aircraft gryo scopes at a few hundred Hz, in
some cases over a kHz, so round off errors can
build very quickly. Any technique that is simple
to compute and has a wide accuracy range is sought
- hence quaternions are used.

Apollo used quaternions for attitude control for
the same reasons.

Philip Oakley

On 5/2/2010 8:47:00 PM, philipoakley wrote:
>On 4/29/2010 10:45:39 PM, jmG wrote:
>
>... that in fact no
>>aircraft need such angular
>>accuracy !!!
>>But Philip insisted and made
>>his point on AOPS reduction
>>based QuatRot.
>>
>>jmG
>
>Jean,
>
>The reason that the aircraft do rely on
>quaternions is because they are
>computing the
>compound action of the roll, pitch and
>yaw from
>the aircraft gryo scopes at a few
>hundred Hz, in
>some cases over a kHz, so round off
>errors can
>build very quickly. Any technique that
>is simple
>to compute and has a wide accuracy range
>is sought
>- hence quaternions are used.
>
>Apollo used quaternions for attitude
>control for
>the same reasons.
>
>Philip Oakley
_____________________________________

I understand all that Philip, and take it graciously. In my times, computers were mostly analog, black boxes [Dassault was a big black box by itself]. My first employer had the contract for the automatic pilot of the Concorde, even that one was dark gray. Quaternions are then new to me, but from some of the work sheets, a bit mystic as there are only 3 axes and 4 inputs. I'm haunted by: how is the quaternion vector [4 inputs] collected from a 3 axes system.

Very interesting.

Jean
PhilipOakley
5-Regular Member
(To:ptc-1368288)

On 5/2/2010 10:49:13 PM, jmG wrote:

>Quaternions are then new to me, but from
>some of the work sheets, a bit mystic as
>there are only 3 axes and 4 inputs.

>I'm
>haunted by: how is the quaternion vector
>[4 inputs] collected from a 3 axes
>system.
>
>Very interesting.
>
>Jean

They certainly can be confusing..... which is why I have been pursuing the discussion.

[3->4 componet question]
When they take in the small angle rotations (for a delta t step) the values in radians are placed as the three 'vector' elements, and the scalar part is left as 1 (unity). This is essentially a tan(theta) approximation). Plus the p=qrq* formulation means that they can use theta/2, rather than theta, so the range of near linear angles increase, and they have pushed the 'bad' scalar part (1 ratehr than cos(theta)) into a component that can be ignored (that is, we know the object hasn't expanded, so we can ignore the scale change!).

There are still one or two 'Mathematics to Engineering' steps I'm trying to make sure I fully comprehend, but I feel I'm pretty close.

Philip Oakley

1) The scalar part of a quaternion is not the scaling. The scaling of a quaternion is the magnitude of the quaternion -- that involves all the components.

2) Using p=qrq-1 the scaling (magnitude) of q doesn't matter -- it cancels out between the direct multiplication and the multiplicatin by the inverse. The p=qrq* applies specifically when the magnitude (not the scalar part) of q is 1. For a unit quaternion, q-1=p* (the reciprocal is the conjugate).


You would not put three angles as the three components of a vector part of a quaternion. For rotation around one of the coordinate axes the rotation quaternion (using the inverse, not conjugate, formulation) can be represented with a scalar part of 1 (an arbitrary reference, not a scale) and sin½θ in the position of the vector part corresponding to the rotation axis. For small enouth θ one can use the small angle approximation to the sine. For a general rotation, given as three rotations around the three coordinate axes, you have to create the rotation quaternion for each axes separately and then multiply the quaternions (in the proper order, depending on the order in which the rotations are applies -- note that the non-commutativity of rotations matches the non-commutativity of quaternion multiplication). The resulting rotation quaternion would usually then be normalized to unit length to allow for the simpler conjugate form for the rotation.
__________________
� � � � Tom Gutman
PhilipOakley
5-Regular Member
(To:TomGutman)

On 5/3/2010 3:22:27 PM, Tom_Gutman wrote:
>1) The scalar part of a
>quaternion is not the scaling.
>The scaling of a quaternion is
>the magnitude of the
>quaternion -- that involves
>all the components.
>
>2) Using p=qrq-1 the scaling
>(magnitude) of q doesn't
>matter -- it cancels out
>between the direct
>multiplication and the
>multiplicatin by the inverse.
>The p=qrq* applies
>specifically when the
>magnitude (not the scalar
>part) of q is 1. For a unit
>quaternion, q-1=p* (the
>reciprocal is the conjugate).
>
>
>You would not put three angles
>as the three components of a
>vector part of a quaternion.
>For rotation around one of the
>coordinate axes the rotation
>quaternion (using the inverse,
>not conjugate, formulation)
>can be represented with a
>scalar part of 1 (an arbitrary
>reference, not a scale) and
>sin�θ in the
>position of the vector part
>corresponding to the rotation
>axis. For small enouth
>θ one can use the small
>angle approximation to the
>sine. For a general rotation,
>given as three rotations
>around the three coordinate
>axes, you have to create the
>rotation quaternion for each
>axes separately and then
>multiply the quaternions (in
>the proper order, depending on
>the order in which the
>rotations are applies -- note
>that the non-commutativity of
>rotations matches the
>non-commutativity of
>quaternion multiplication).
>The resulting rotation
>quaternion would usually then
>be normalized to unit length
>to allow for the simpler
>conjugate form for the
>rotation.
>__________________
>� � � � Tom Gutman

Tom,
Whilst you are correct in the mathematics, I was referring to how they are used in 'practice' in
engineering/computing.
In particular, it is their use for small angle
stuff (and integral over a path/time to get larger
angles) that I was commenting on.
They do do the 'cheats' by using q* instead of q^-
1, and use 1 instead of cos(theta), and then
theta/2 instead of sin(theta/2).
The big "however" is that even with these rather
gross assumptions (with theta of up to 10 degrees
apparently) they still get remarkable accuracy
overall.
My interest, as an engineer, is to fully
understand just why, and how, that is realized,
and to be able to explain it to others (which is
the hard bit!)

My apologies for being a bit fast and loose with
some of the terminology....

Philip Oakley

For the trigonometric functions the small angle approximation, for slide rule accuracy, is usually taken to apply at about 5°.

The use of P* instead of p-1 is close, since if the vector part is small the magnitude will be near one. If the length of the vectors being rotated is known (say unit vectors, so that only the direction matters) even that appoximation doesn't matter, the vectors can be normalized at the end.

Placing all three angles into one vector is an approximation to the product, if the angles are small enough. But it is not as good an approximation as the trigonometric one, and would require rather smaller angles (perhaps one tenths the size) for reasonable accuracy.
__________________
� � � � Tom Gutman

Slight correction -- with the scalar part set to one, the single vector comonent is tan½θ, not the sine as I had written. The small angle approximation is the same, though.
__________________
� � � � Tom Gutman

Thus i,j,k imasginary operators are not used in flight corrections. A sort of creeping back & forth zig-zag path. In 1935 AD info was from a offset source scanning a conical surface axis inside a parabolic reflector, then replaced by 4-horn or monopulse vector operations feeding controls. i,j,k are not used unless a complete turn or flight reveral was wanted. Attempts to track a moving target under command by sending flight corrections over the same radar beam were not perfected.

On 5/2/2010 8:47:00 PM, philipoakley wrote:


>Apollo used quaternions for attitude
>control for
>the same reasons.



Apollo flight director attitude indicator.

Regards. Alvaro.
Top Tags