The art of shimming an nmr magnet is often made unnecessarily difficult by the belief that the process is too complex for a straightforward approach. While the room-temperature shims (RTS) provided on all superconducting NMR systems today do contain many interactions, a logical approach to shimming is nevertheless the best way to optimize the magnetic field. If you know which shims are interacting, then you can devise a system which eliminates many uncertainties from the shimming operation. Also, there is no substitute for experience when it comes to shimming. As I tell all new users, learning to shim the magnet is like learning to ride a bicycle ... you can be told how to do it but there is simply no substitute for actually doing it!

More than likely you will never have to go through the complete shimming
procedure given below, rather you will probably only have to adjust the
Z ^{1} and Z^{2} shims. Less frequently the Z^{3}
and Z ^{4} shims will need adjustment. Nonetheless it is instructive
to see what the whole procedure is. Also, the figure at the end of this
article shows the lineshapes corresponding to maladjusted shims ... very
useful for knowing which shims are out of adjustment. Also useful, is the
technique of adjusting the shims while looking at a real-time display of
the lineshapes in your spectrum. How to do this is discussed below.

The shims on most NMR magnets are designed to approximate the spherical-harmonic functions given in Table 1. These functions are orthogonal (independent) over any sphere centered at the origin. Some possible causes for shim interactions are a) the sample is not spherical b) the sample is not centered at the origin c) the real shims are imperfectly described by their model functions and d) the probe does not excite and measure the NMR signal in all regions of the sample equally.

Table 1

Shim Function

Z0 1

Z^{1}
Z

Z^{2}
2Z ^{2}-(X^{2}+Y ^{2})

Z^{3}
Z[2Z ^{2}-3(X^{2}+Y ^{2})]

Z^{4}
8Z ^{2}[Z^{2}-3(X ^{2}+Y^{2}) + 3(X
^{2
}+Y^{2})^{2}

Z^{5}
48Z ^{3}[Z^{2}-5(X ^{2}+Y^{2})] + 90Z(X
^{2
}+Y^{2})^{2}

X X

Y Y

ZX ZX

ZY ZY

XY XY

X2-Y2
X
^{2} - Y ^{2}

Z2X
X[4Z
^{2 }-(X^{2}+Y^{2})]

Z2Y
Y[4Z
^{2 }-(X^{2}+Y^{2})]

ZXY ZXY

Z(X2-Y2)
Z(X
^{2} - Y ^{2})

X3
X(X
^{2 }- 3Y^{2})

Y3
Y(3X ^{2} - Y^{2})

**General shimming instructions**

All of the instructions in this article are directed towards maximizing the lock signal. Another criterion for evaluating the homogeneity, such as the total area of the FID or a real-time fourier transform ( see the end of this article for more information on this technique ) of the spectrum could be used. Final shim adjustments should be made while the system is locked on the desired sample. Start with the lock level adjusted to 80% of its maximum value, in other words the lock signal is 80% of the way up the lock window. Be absolutely sure that the phase of the lock system is adjusted properly. If the lock signal becomes too large (or too small) then readjust the the lock level to 75-80% using the lock gain and start the current step of the procedure over again. In all of the shimming procedures, continue adjusting the shims in the same direction until you see a 20 unit decrease in the lock level, and then back up until you reach the maximum lock level. If you do not do this, then you will often fail to find the true maximum.

All of the following procedures are designed to minimize the complications introdued by the shim interactions. However, you will observe that, when the resolution becomes better, the shims can be adjusted directly without recourese to these procedures. In other words, when the shims have been adjusted close to their proper values, they will drive directly to those values.

It is important to decouple the spinning and nonspinning shims by alternating
between spinning and nonspinning during the shimming process. During all
shimming operations, adjust Z^{2} - Z^{5} only while the
sample is spinning, Z^{1} should usually be adjusted while the
sample is spinning, but it can also be adjusted whil the sample is not
spinning as described in the procedures.

**Spinning shims**

Spin the sample at 20-30 Hz whenever you are adjusting the spinning shims.

**Z ^{1} and Z^{2}**

Adjust Z^{1} to obtain a maximum reading on the lock level display.
Move Z^{2} in the negative direction to decrease the meter reading
20 units. Reoptimize Z^{1}. If this maximum is greater than the
previous maximum, then change the Z^{2} setting enough to lower
the lock level 20 units and reoptimize Z^{1}. Continue this process
until the best combination of Z^{1} and Z^{2} is found.
Continue past what you think is the maximum to be sure that you have really
found it.

If the first new setting of Z^{2} in the procedure above leads
to a decrease in the lock level after you reoptimize Z^{1}, then
move Z ^{2 }in the positive direction until the lock level decreases
20 units and reoptimize Z^{1}. Follow the procedure above, except
continue to change Z^{2} in the positive direction until the best
combination of Z ^{1} and Z^{2} is found.

**Z ^{3}**

Move Z^{3} in the negative direction to decrease the lock meter
reading 30 units. Optimize Z^{1}. If this new maximum is greater
than the previous maximum, then move Z^{3} in the negative direction
until the lock level decreases 30 units and reoptimize Z^{1}. Continue
this process until you find the best combination of Z^{1} and Z^{3
}.

If moving Z^{3} in the negative direction produces a decrease
in the lock level after you optimize Z^{1}, then move Z^{3}
in the positive direction until the lock level decreases 30 units. Repeat
the procedure above, except move Z^{3} in the positive direction
until you find the best combination of Z^{1} and Z^{3}.

After you find the best combination of Z^{1} and Z^{3 },
repeat the procedure for Z^{1} and Z^{2}. If this yields
a better maximum, then repeat the Z^{3} procedure. Repeat this
entire cycle until you observe no further gain in the lock level.

**Z ^{4}**

Move Z^{4} in the negative direction to decrease the lock level
40 units. Optimize Z^{2}, and then optimize Z^{1}. If this
yields a better lock level than existed at the start of the process, then
continue in this direction until you find the best setting for Z^{4
}.
If this process yields a lower lock level, then move Z^{4} in the
positive direction, and repeat the process above until you find the best
Z ^{4 }setting.

It is sometimes necessary to interactively adjust Z^{3} and
Z ^{4}. To do this, move Z^{4} in one direction, maximize
the lock sevel with Z^{3}, and the maximize the lock level with
Z^{1 }. continue this process until you find the best setting for
Z^{4 }. Make sure that when Z^{4} is moved, the change
is large enough to decrease the lock level at least 40 units. Neglecting
to make large enough changes in Z^{4} followed by remaximizing
the locke level with the orther Z controls is the most frequent reason
for failing to obtain the best Z ^{4} setting.

**Z ^{5}**

Move Z^{5} in one direction to decrease the lock level 40 units.
Maximize the lock level with Z^{3}, and then maximize the locke
level with Z^{1}. If this lock level is greater than the original
maximum, then move Z^{5} some more in the same direction and repeat
the process. If the lock level is less, then move Z^{5} in the
opposite direction and repeat the process. Continue this procedure until
you find the best Z^{5} setting. There is often a broad range of
Z ^{5} settings in which the lock level remains about the same.
Find the setting at each end of this range, where the remaximized lock
level definitely decreases, and set Z^{5} in the middle of this
range.

**Non-spinning Shims**

When you are adjusting the nonspinning shims, adjust the lock level to 80% of maximum with the lock gain and do not spin the sample.

**X and ZX**

Move ZX in one direction to decrease the lock level 20 units. Maximize
the lock level with X and then with Z^{1}. If thes new lock level
is better than the original lock level, then continue the procedure by
adjusting ZX in the same direction. If the new lock level is lower, then
move ZX in the opposite direction. Continue the procedure until you find
the best settings for X and ZX.

It is necessary to adjust Z^{1} when adjusting ZX becuase of
the Z ^{1} impurity in the ZX shime. If you change Z^{1}
significantly in this process, then spin the sample and reoptimize Z^{1
}and
Z^{2} before proceeding. This is necessary to decouple the ZX and
Z^{1} shims as much as possible; otherwise the process becomes
complicated.

**Y and ZY**

The procedure for adjustin Y and ZY is analgous to that for adjusting X and ZX.

**XY and X ^{2}-Y^{2}**

Maximize the lock level with XY and then with X^{2}-Y^{2
}.
Repeat the process until you find the best settings. Then repeat the procedure
for X and ZX and the procedure for Y and ZY. Continue this entire cycle
until no further improvements can be made.

**Z ^{2}X**

With the sample not spinning, move Z^{2}X in one direction to
lower the lock level 40 units. Maximize the lock level by adjusting ZX,
Z ^{1 }and X in that order. If this new lock level is better than
the previous locke level, then continue adjusting Z^{2}X in the
same direction. If the new locke level is lower, then adjust Z^{2}X
in the other direction. If you make a significant change in Z^{1},
then spin the sample and remaximize the lock level by adjusting Z1 and
Z^{2}. If you make a significant change in Z^{2}X , then
spin the sample and follow the procedure for adjusting Z^{3} again.
A significant change in Z ^{2}X usually leads to a change in Z^{3}.

**Z ^{2}Y**

The procedure for adjustin Z^{2}Y is analogous to that for adjusting
Z^{2}X. Substitute Z^{2}Y, ZY and Y for Z^{2 }X,
ZX and X in that procedure.

**ZXY**

Move ZXY in one direction to lower the lock level 10 units. Carry out
the procedure for adjusting XY and X^{2}-Y^{2}. If the
new lock level is larger than the original lock level then continue in
the same direction with ZXY. If it is smaller then adjust ZXY in the opposite
direction.

**Z(X ^{2}-Y^{2})**

Move Z(X^{2}-Y^{2}) in one direction to lower the lock
level 10 units and then follow the procedure for adjustin XY and X^{2
}-Y^{2.
}If the new locke level is higher than the original lock level then
continue in the same direction with Z(X^{2}-Y^{2
}) until
you find the best setting. If the lock level is lower then try the other
direction.

**X ^{3}**

Move X^{3} in one direction to lower the lock level 10 units.
Remaximize the lock level with X and Y. If the lock level is greater than
the original lock level then continue adjusting X^{3} in the same
direction. If it is less then try the other direction.

**Y ^{3}**

The procedure for adjustin Y^{3} is analgous to that for adjusting
X ^{3}.

**Maladjustment Symptoms**

You can often tell which shim is out of adjustment by examing the lineshape. A symmetrical lineshape distortion is always produced by an odd-order shim. This can be seen by examining the equations in the table. Likewise, an asymmetrical lineshape distortion is produced by an even-order shim. These types of distortions are shown in the following figure. the higher the order of the gradient which is causing the distortion the farther down the peak the distortion occurs.

The nonspinning shims which produce one cycle of field gradient per
revolution of the sample produce the first order spinning sidebands. The
nonspinning shims which produce two cycles of field gradient per revolution
give rise to the second order spinning sidebands. The third order, nonspinning
shims produce both spinning sidebands and low order humps. Z^{2}X
and Z ^{2}Y sometimes produce a situation in which adjusting Z^{3
}changes
the spectrum from one with no spinning sidebands and a low order hump to
one with no low order hump and large spinning sidebands. The other third
order, nonspinning shims usually produce only low order humps.

**Real-Time Lineshape Monitoring**

Lineshapes can be monitored in real time during shimming on the AMX 300 spectrometer. The spectrometer issues a pulse, receives the signal and transforms it into a frequency domain spectrum and phase corrects it continuously in 'gs mode'. In order to phase correct there must already be phase correction constants for the current sample in memory. This means that in order to do this, one must first acquire a spectrum as usual, transform it and manually phase correct it. Then, after switching to the acquisition screen, the spectrometer is put into setup mode by typing 'gs'. The acquired fid will be continuously displayed by default but this can be changed to the transformed spectrum by clicking the middle mouse button while the mouse cursor is over the button containing 'F' and 'S' (standing for fid and spectrum respectively). This will change the display to the continuously updated transformed/phase corrected spectrum. A bug in the program initially displays the real and imaginary data but clicking on any button (the vertical zoom for example) will change this to real only display. You can now shim while looking at the effect of the changes on the spectral lineshapes ... very useful.