We describe the formalism for optimally estimating and controlling both the
state of a spin ensemble and a scalar magnetic field with information obtained
from a continuous quantum limited measurement of the spin precession due to the
field. The full quantum parameter estimation model is reduced to a simplified
equivalent representation to which classical estimation and control theory is
applied. We consider both the tracking of static and fluctuating fields in the
transient and steady state regimes. By using feedback control, the field
estimation can be made robust to uncertainty about the total spin number