For a 5mm resolution, what max height distance are you looking for ?? A system I've worked on with huge trucks and injection moulding
machines is linear transducers. Very easy to use and all lengths. You don't need one the full length, I've seen many clever methods of
doing "mechanical" ratio reduction. Those things can get you >1mm resolution and better, so you're good for 5:1 reduction +