Design for robustness and cost effectiveness: the case of an optical profilometer