  An energy functional for orbital based $O(N)$ calculations is proposed, which
depends on a number of non orthogonal, localized orbitals larger than the
number of occupied states in the system, and on a parameter, the electronic
chemical potential, determining the number of electrons. We show that the
minimization of the functional with respect to overlapping localized orbitals
can be performed so as to attain directly the ground state energy, without
being trapped at local minima. The present approach overcomes the multiple
minima problem present within the original formulation of orbital based $O(N)$
methods; it therefore makes it possible to perform $O(N)$ calculations for an
arbitrary system, without including any information about the system bonding
properties in the construction of the input wavefunctions. Furthermore, while
retaining the same computational cost as the original approach, our formulation
allows one to improve the variational estimate of the ground state energy, and
the energy conservation during a molecular dynamics run. Several numerical
examples for surfaces, bulk systems and clusters are presented and discussed.
