Monthly Archives: April 2014


The accurate measurement of the spatial distribution of field in the as-wound magnet is essential to shimming to high ho­mogeneity. Sometimes, measurement of the field is possible at very low field strengths with tiny currents flowing in the windings at room temperature. That may allow mechanical adjustment of the positions of the main compensations coils (k – k in Fig. 6) to reduce the B(1,0), B(2,0) and B(1,1) har­monics. Major field measurement is made with the magnet at design field strength and in persistent mode. The methods of measurement in NMR and MRI magnets are generally dif­ferent.

In NMR magnets, because of the small bore, the field is measured by a small NMR probe on the surface of a cylindri­cal region about 8 mm diameter and over a length of up to 10 mm. The measurements are made at typically 20° azimuthal intervals. From these field measurements, the predominant harmonics can be deduced, using a least-squares fit, and shimmed by means of the superconducting shim coils, both axial and radial. With subsequent measurements, as the har­monic content becomes smaller, the higher harmonics become evident and in turn can be shimmed. The field measurements are usually reduced to harmonic values because the shim sets are designed to generate specific harmonics. The correcting current required in any particular shim set is then immedi­ately determined. Measurement and shimming is always an iterative process, generally requiring several iterations to achieve homogeneities of better than 10-9 over 5 mm dsv.

Field measurement in an MRI magnet is usually per­formed differently because much more space is available and because knowledge of the magnitudes of the harmonics in as­sociated Legendre polynomial form is an advantage in the shimming process. In this case, the measuring points will lie on the surface of a sphere. Typically, the diameter of this sphere may be 500 mm. The field is measured at intervals of ф, often 30°, around each of the circles of intersection with this spherical surface of several z = const planes, called Gauss planes. From these measurements and by the property of orthogonality of the associated Legendre functions, the val­ues of the constants Cn, m and Sn, m in Eq. (10) can be deduced by the following methodology.

The double integral


+1 /»2 n

I P(n, m)(u)[cos(m^)]Pi j(u)[cos(j0)]du. d(p

1 J0 ’

is nonzero only if i = n and j = m. Then, for m > 0, its value is

2n(n + m)!/(2n + 1)(n — m)!

So, if both sides of Eq. (10) are multiplied by Pij(u)[cos( j4>)] or PiJ(w)[sin( j4>)] and double integrated, the right-hand side will be nonzero only if i = n and j = m. Then


+1 /»2n

I Bz(n, m)P; j(u)[cos(jф)]йи. йф

1 Jo

— Cn, mrn (n + m + 1)2n(n + m)!/(2n + 1)(n — m)!



»+1 r2n

Bz(n, m)Pt j(u)[sin(^)]в, иАф

— Sn, mrn (n + m + 1)2n(n + m)!/(2n + 1)(n — m)! (16)

Equation (16) are realized in practice by the measurement of the field at each of 60 points (for example) and the multiplica­tion of each value by the spherical harmonics, Pju) cos( j4>) and Pij(u) sin( j4>) at that point. The integration is numerical. The method usually employed is Gaussian quadrature, simi­lar in principle to Simpson’s rule for numerical integration in Cartesian coordinates, but in which the z = const planes are the roots of the Legendre polynomial and the weights as­signed to the values measured on each of these planes are derived from the Lagrangian. Tables of the roots and weights are found in standard texts on numerical analysis (14). For the purposes of example, assume the number of planes p = 5, and the number of azimuthal points per plane q = 12, for a total of 60 points on the surface. The planes are at z/r = 0, z/r = ±0.5385, and z/r = ±0.9062; r is the radius of the spherical surface. The corresponding weights are 0.5689,

0. 4786, and 0.2369. The measurements are made on the cir­cles of intersection and two numerical integrations of Eq. (16) performed, one for the cos(mфв) terms and the other for the sin(m^e) terms. Then the values of Cnm and Sn, m are obtained from

C —

^n, m —

Y2Y2WqB(up, фq )Pn, m (up ) ^^фд)


x [(2n + 1)(n — m)!]/[2nrn(n + m + 1)!]


Sn, m = YhWqB(up, фq )Pn, m (up ) SІn(mфд)j

x [(2n + 1)(n — m)!]/[2nrn(n + m + 1)!]

where B(up, ф<?) is the field at the point p, q, the subscripts p and q denote each of the 60 points, and wq is the Gaussian weighting for the plane q.


The motion of a rigid body in three-dimensional space is de­termined by the forces and moments acting on the body at each instant of time. There are two main types of general motion of a rigid body: (1) translational motion, which typi­cally deals with the velocity and position of the center of mass of the body, and (2) rotational or attitude motion, which typi­cally deals with the (angular) velocity and (angular) position about the center of mass. The angular position about the cen­ter of mass is often referred to as the attitude or orientation of the body. The choice of the center of mass as the reference point to describe the general body motion is not restrictive, but it has the advantage of allowing the rotation and transla­tion to be treated separately. That is, the translation of the body center of mass does not affect nor is it affected by the rotation of the body about the center of mass.

To understand the two types of motion, consider the exam­ple of a spacecraft traveling in space. The spacecraft trans­lates and rotates at the same time. For an observer located on Earth, the spacecraft can be thought of as a single particle, and its trajectory through space is primarily determined by its instantaneous position and velocity. Its orientation with respect to Earth is irrelevant (unless a communication an­tenna needs to be always pointing toward Earth) or very dif­ficult to observe from such a large distance. On the other hand, as the same observer moves closer and closer to the spacecraft, the orientation of the spacecraft may be very im­portant, and it certainly becomes much more obvious.

Translational motion therefore deals with the motion of particles, that is, idealized points with zero dimensions but nonzero mass. Rotational motion, on the other hand, deals with the motion of rigid bodies, that is, physical objects with nonzero dimensions and nonzero mass. One can safely think of translation as the macroscopic, or far-away view of the mo­tion of an object and of rotation as the microscopic, or close – by view of the motion.

Dynamics of the Attitude Motion

The dynamic equations of the attitude motion of a rotating body describe the behavior of the angular momentum or the angular velocity vector as a function of the externally applied torques or moments. The basic equation that governs the body behavior under external torques is Euler’s equation of motion (2). It states that the rate of change of the angular momentum vector H of the body at every instant is equal to the applied moment M






where the angular momentum is defined by H= rx vdm


and the integration extends over the entire body. In Eq. (2) the vector v = r denotes the inertial velocity of the mass ele­ment dm (see Fig. 1).


Figure 1. Inertial and body-fixed reference frames. The body-fixed reference frame is located at the center of mass cm. The vector r denotes the location of the element mass dm in the inertial frame and the vector p denotes the location of the mass in the body frame.




















The time derivative in Eq. (1) must be taken with respect to an inertial reference frame. In addition, in the calculation of H we have a choice of the reference point about which to calculate the moments and the angular momentum. Equation (1) implies that we have chosen either a point fixed in inertial space or the center of mass. The center of mass offers the most convenient and natural choice. In this case, from Fig. 1 we have that the location of the mass element dm is at r = R + p, where R denotes the location of the center of mass.

Differentiation of a vector V, as seen from an inertial frame, is related to differentiation as seen in a moving (body) frame through the relationship

The moment-of-inertia matrix depends on the shape of the body and the manner in which its mass is distributed. The larger the moments of inertia the greater resistance the body will have to rotation.

When using Eq. (3) and recalling that in a body-fixed frame the inertia matrix is constant, it follows that Eq. (1) can be written as


1 xydm




1 xzdm


Jyz =





JO + о x Jo = M


where ы is the angular velocity of the moving frame. The ve­locity of the mass element dm is thus given by

v = R+ о x p (4)

Subsequently, the angular momentum vector is given by

H = / p x R dm + I p x (о x p) dm (5)

J в J в

The first integral in the previous expression vanishes, be­cause the origin is at the center of mass

I p dm = 0 (6)

J в

The angular momentum vector with respect to the center of mass is thus

H = / p x (о x p)dm (7)


Since the position vector p changes with time in an inertial frame, it is beneficial to choose a reference frame fixed in the body, since in this case the mass distribution does not change.

Therefore, choosing a reference frame fixed in the body and located at the center of mass, we can express ы and p in this body-fixed frame as

о = Oxi + Oyj + Oz k, p = xi + yj + zk (8)

Then Eq. (7) yields

H = Jo (9)

where J is the moment-of-inertia matrix and is given by





J =



– Jyz






The inertia matrix J, also called the inertia tensor, is symmet­ric and positive definite. One can therefore choose a reference frame such that the matrix J is diagonal. This particular choice of body-fixed axes is called the axes of principal mo­ments of inertia. The directions of these axes are exactly those determined by the eigenvectors of the matrix J.

The components of Eq. (12) resolved along the principal axes are given by

JxO x = (Jy — Jz )OyOz + Mx

JyO y = (Jz — Jx )OzOy + Mz (13)

JzO z = (Jx — Jy )OxOy + Mz

where Jx, Jy, Jz are the three principal moments of inertia (the eigenvalues of the matrix J), wx, wy, wz are the components of the angular velocity vector along the principal axes, as in Eq. (8), and Mx, My, Mz are the components of the applied moment along the same set of axes, i. e., M = Mxi + My j Mzk.

Equation (12) or Eq. (13) is the starting point for most atti­tude control problems.

Kinematics of the Attitude Motion

The solution of Eq. (13) provides the instantaneous angular velocity of the body about its center of mass. It does not cap­ture the instantaneous orientation of the body with respect to, say, the inertial reference frame. In particular, integration of the angular velocity vector w does not, in general, give any useful information about the orientation of the body. The ori­entation of the body is completely determined if we know the orientation of the body-fixed frame with respect to the inertial reference frame, used in deriving Eq. (13). The rotation matrix R between the body-fixed and the inertial reference frames is used to completely describe the body orientation. The rotation matrix is a 3 X 3 matrix having as columns the components of the unit vectors of the inertial frame expressed in terms of the unit vectors of the body-fixed frame.

In other words, i, j, k denote the unit vectors of the body frame and I, J, K denote the unit vectors in the inertial frame, a vector V having coordinates (Vx, Vy, Vz) and (VX, VY, VZ) with
respect to the body-fixed and inertial frames, respectively, can be written as


V = Vxi + Vy j + Vz k = VXI + VYJ + VZK


The matrix R establishes the following relation between the coordinates of V in the two reference frames




= R






If ы = wxi + wyj + wzk denotes the angular velocity of the body frame with respect to the inertial frame (expressed in the body frame coordinates), the differential equation satisfied by R is given by (3,4)



where S(w) is the skew-symmetric matrix (S = —ST)












S(a) =


rotations. Several definitions of the Euler angles are possible, depending on the choice of the axes of rotations and the par­ticular order in which the rotations are performed. In fact, there are 12 different possible choices of Euler angle sets. These sets have been discussed in great detail elsewhere (3). One of the most common choices in aircraft and spacecraft attitude control problems is the (3-2-1) Euler angle sequence. According to this set of Euler angles, the orientation of the body-fixed reference frame with respect to the inertial refer­ence frame is described by a sequence of the following three elementary rotations:

1. First rotate the inertial reference frame about its Z axis through an angle ф to the new axes x’ — y’ — z’.

2. Then rotate about the y’ axis by an angle в to the new axes x" — y" — z".

3. Finally rotate about the x" axis by an angle ф to the final body-axes x, y, z.

This sequence of rotations that takes the inertial frame to coincide with the body frame after three rotations is depicted in Fig. 2. Note that the order of rotations is very important. The angles ф, в, and ф are called the roll, pitch, and yaw angles.

The elementary rotations of a reference frame about the axes x, y, and z are given, respectively, by




Rx (Ф) =


cos Ф

sin Ф


sin Ф

cos Ф

cos 0


— sin 0

Ry (0) =




sin 0


cos 0

and it is also proper, that is, its determinant is +1. Equation (16) can also be used to calculate the angular velocity if the rate of change of R is known

It can be shown that the matrix R is orthogonal, that is, it satisfies


S(&) = Rrt

We can use Eq. (16) to find the orientation of the body at any instant of time if the corresponding angular velocity vector ы of the body is known. In particular, the matrix differential equation in Eq. (16) can be integrated from the known initial attitude of the body to propagate the attitude for all future times. This process will require the integration of the nine linear but time-varying differential equations for the ele­ments of the matrix R in order to obtain R(t) at each time t. Careful examination of the matrix R, however, reveals that the nine elements of this matrix are not independent from each other, since the matrix R must necessarily satisfy the constraints in Eq. (18). An alternative approach to solving Eq. (16) is to parameterize the matrix R in terms of some other variables and then use the differential equations of these variables in order to propagate the attitude history.

Euler Angles. The minimum number of parameters that can be used to parameterize all nine elements of R is three. [No­tice that Eq. (18) imposes six independent constraints among the elements of R.] The Euler angles are the most commonly used three-dimensional parameterization of the rotation ma­trix R. They have the advantage that they are amenable to physical interpretation and can be easily visualized.

Using the Euler angles we can describe the final orienta­tion of the body-axis frame by three successive elementary



cos t sin t 0

— sin t cos t 0

Rz (t) =






Figure 2. Euler angle sequence (3-2-1). We align the inertial and body frames by first rotating with an angle ф about the z axis, then rotating with an angle в about the new y axis, and finally rotating with an angle ф about the x axis.



and thus

The rotation matrix in terms of the (3-2-1) Euler angles can thus be expressed in terms of the three previous elementary rotations by

R(f, в, ф) = Rx(^)Ry(0)Rz(f)

The Euler parameters satisfy the constraint

<?2 + q1 + q2 + q2 =1

The quantity

q = qo + q^ + q2 j + q3k



cos f cos в

R(f,0^) = — sin f cos ф + cos f sin в sin Ф

sin f sin ф + cos f sin в cos ф

sin f cos в — sin в

cos f cos ф + sin f sin в sin ф cos в sin ф — cos f sin ф + sin f sin в cos ф cos в cos ф

The components of the angular velocity vector in the body – frame are given in terms of the rates of these Euler angles by

Ox = —f sin в + ф

Oy = f cos в sin ф + в cos ф

Oz = f cos в cos ф — в sin ф

defined from the Euler parameters is called the quaternion (4,7). It should be pointed out that there is often a confusion in the literature about this term. With a slight abuse of termi­nology, many authors refer to the Euler parameters q0, q1, q2, q3 as the quaternion although, strictly speaking, this is incorrect.

The rotation matrix in terms of the Euler parameters is given by

R(qo, q, q2, q3)

q2 + q— q2— q2 2(qq + qoq3)

20зд3— qoq2) 2(q1q2 — qoq3) q2 — q1 + q2 — q3 2(q2q3 + qoqx)

2(qxq3 + qoq2) 2(q2q3 — qoqx) q2 — q — q + q3


and the corresponding kinematic equations are given by





“ 2










o —Ox —Oy —Oz




o Oz

—Oz o

Oy Ov




tan ф =


q0 = cos —, qi = ei sin —, і = 1, 2, 3

The previous equation indicates that there is a singularity when в = ±n/2. This singularity does not allow for a global parameterization of the attitude using the Euler angles. The previous (3-2-1) Euler sequence, for example, is defined only for — n < ф < n, — n/2 < в< n/2, and —n< ф < n. Other three­dimensional parameterizations include the Cayley-Rodrigues parameters and the modified Rodrigues parameters (4). How­ever, the singularity problem is always present, when using a three-dimensional parameterization of the rotation matrix R (5). Higher order parameterizations need to be used to avoid singularities.

Euler Parameters (Quaternions). A four-dimensional param­eterization of the attitude kinematics that does not have any singularities is given by the Euler parameters. The Euler pa­rameters are defined via Euler’s theorem, which can be stated as follows (6):

The most general displacement of a rigid body with one point fixed is equivalent to a single rotation about some axis through that point.

The corresponding axis is called the eigenaxis of rotation, and and the corresponding angle is called the principal angle. If the eigenaxis unit vector is e = e1i + ej + e3k and the princi­pal angle is Ф, the Euler parameters are defined by

Conversely, we can solve the previous equations and express the rates of the Euler angles in terms of the angular velocity components in the body-frame

ф = ox + oy tan в sin ф + oz tan в cos ф в = oy cos ф — oz sin ф f = Oy sec в sin ф + Oz sec в cos ф



These equations are linear and do not involve any trigonomet­ric functions as the corresponding kinematic equations in terms of the Euler angles. Integration of these equations to obtain attitude information can thus be performed very fast on a computer. In addition, the attitude description in terms of qo, q1, q2, q3 is global and nonsingular. For these reasons the Euler parameters have increasingly gained popularity in many attitude-control applications.

The main disadvantage when using the Euler parameters is that they are difficult to visualize. The orientation needs to be transformed to an Euler angle sequence if they are to be meaningful, for example to a pilot or an engineer. The Eu – lerian angles (ф, в, ф) in terms of the Euler parameters can be computed, for example, from

sin в = 2(q^3 — qoq2)

2(qxq2 + qoq3)

The Euler parameters are related to the (3-2-1) Euler angles by

qo = cos (ф/2) cos^/2) cos^/2) + sin^/2) sin(в/2) sin(f/2) q1 = sin^/2) cos(в/2) cos(f/2) — cos^/2) sin(в/2) sin(f/2) q2 = cos (ф/2) sin(в/2) cos(f/2) + sin(ф/2) cos^/2) sin(f/2) q3 = cos(ф/2) cos^/2) sin(f/2) — sin(ф/2) sin(в/2) cos(f/2)


q2 + q? — q2 — q3

2(<?2<?з +<?o<?i)


q2 — q2 + q3

tan f =


Careful examination of Eq. (28) shows that both a given set of values of q0, q1, q2, q3, as well as and their negatives give the same rotation matrix R. Every orientation corresponds to two different sets of Euler parameters. This slight ambiguity has no significant effect in applications, however.