Autotuning control of a precision balance for mass and density measurement