  The migration and encounter histories of the giant planets in our Solar
System can be constrained by the obliquities of Jupiter and Saturn. We have
performed secular simulations with imposed migration and N-body simulations
with planetesimals to study the expected obliquity distribution of migrating
planets with initial conditions resembling those of the smooth migration model,
the resonant Nice model and two models with five giant planets initially in
resonance (one compact and one loose configuration). For smooth migration, the
secular spin-orbit resonance mechanism can tilt Saturn's spin axis to the
current obliquity if the product of the migration time scale and the orbital
inclinations is sufficiently large (exceeding 30 Myr deg). For the resonant
Nice model with imposed migration, it is difficult to reproduce today's
obliquity values, because the compactness of the initial system raises the
frequency that tilts Saturn above the spin precession frequency of Jupiter,
causing a Jupiter spin-orbit resonance crossing. Migration time scales
sufficiently long to tilt Saturn generally suffice to tilt Jupiter more than is
observed. The full N-body simulations tell a somewhat different story, with
Jupiter generally being tilted as often as Saturn, but on average having a
higher obliquity. The main obstacle is the final orbital spacing of the giant
planets, coupled with the tail of Neptune's migration. The resonant Nice case
is barely able to simultaneously reproduce the {orbital and spin} properties of
the giant planets, with a probability ~0.15%. The loose five planet model is
unable to match all our constraints (probability <0.08%). The compact five
planet model has the highest chance of matching the orbital and obliquity
constraints simultaneously (probability ~0.3%).
