  The ability to accurately control the dynamics of physical systems by
measurement and feedback is a pillar of modern engineering. Today, the
increasing demand for applied quantum technologies requires to adapt this level
of control to individual quantum systems. Achieving this in an optimal way is a
challenging task that relies on both quantum-limited measurements and
specifically tailored algorithms for state estimation and feedback. Successful
implementations thus far include experiments on the level of optical and atomic
systems. Here we demonstrate real-time optimal control of the quantum
trajectory of an optically trapped nanoparticle. We combine confocal position
sensing close to the Heisenberg limit with optimal state estimation via Kalman
filtering to track the particle motion in phase space in real time with a
position uncertainty of 1.3 times the zero point fluctuation. Optimal feedback
allows us to stabilize the quantum harmonic oscillator to a mean occupation of
$n=0.56\pm0.02$ quanta, realizing quantum ground state cooling from room
temperature. Our work establishes quantum Kalman filtering as a method to
achieve quantum control of mechanical motion, with potential implications for
sensing on all scales. In combination with levitation, this paves the way to
full-scale control over the wavepacket dynamics of solid-state macroscopic
quantum objects in linear and nonlinear systems.
