I have a "stringpot" for sale on Ebay. In case you are not familiar with one of these, they are an easy way to measure distance accurately. It is also formally called a linear distance transducer. It is a very rugged unit, has never been used (except in the lab) and sold for over $500. If you need to measure dynamic changes in distances of up to 30 inches, this is one of the easiest ways to do it. See it here:
formatting link
or look for stringpot on ebay