Werner Heisenberg formulated the uncertainty principle in Niels Bohr's institute at Copenhagen, while working on the mathematical foundations of quantum mechanics.
In 1925, following pioneering work with Hendrik Kramers, Heisenberg developed matrix mechanics, which replaced the ad-hoc old quantum theory with modern quantum mechanics. The central assumption was that the classical motion was not precise at the quantum level, and electrons in an atom did not travel on sharply defined orbits. Rather, the motion was smeared out in a strange way: the time Fourier transform only involving those frequencies that could be seen in quantum jumps.
Heisenberg's paper did not admit any unobservable quantities like the exact position of the electron in an orbit at any time; he only allowed the theorist to talk about the Fourier components of the motion. Since the Fourier components were not defined at the classical frequencies, they could not be used to construct an exact trajectory, so that the formalism could not answer certain overly precise questions about where the electron was or how fast it was going.
About the Uncertainty Principle
In quantum mechanics, the Heisenberg uncertainty principle states that certain pairs of physical properties, like position and momentum, cannot both be known to arbitrary precision. That is, the more precisely one property is known, the less precisely the other can be known. It is impossible to measure simultaneously both position and velocity of a microscopic particle with any degree of accuracy or certainty. This is not only a statement about the limitations of a researcher's ability to measure particular quantities of a system, but once the wave-nature of matter is accepted, the general properties of waves cause the uncertainty principle to be a statement about the nature of the system itself.
In quantum mechanics, a particle is described by a wave. The position is where the wave is concentrated and the momentum is determined by the wavelength. The position is uncertain to the degree that the wave is spread out, and the momentum is uncertain to the degree that the wavelength is ill-defined.
The only kind of wave with a definite position is concentrated at one point, and such a wave has an indefinite wavelength. Conversely, the only kind of wave with a definite wavelength is an infinite regular periodic oscillation over all space, which has no definite position. So in quantum mechanics, there are no states that describe a particle with both a definite position and a definite momentum. The more precise the position, the less precise the momentum.
The uncertainty principle can be restated in terms of measurements, which involves collapse of the wavefunction. When the position is measured, the wavefunction collapses to a narrow bump near the measured value, and the momentum wavefunction becomes spread out. The particle's momentum is left uncertain by an amount inversely proportional to the accuracy of the position measurement. The amount of left-over uncertainty can never be reduced below the limit set by the uncertainty principle, no matter what the measurement process.
This means that the uncertainty principle is related to the observer effect, with which it is often conflated. The uncertainty principle sets a lower limit to how small the momentum disturbance in an accurate position experiment can be, and vice versa for momentum experiments.