Position-sensing cylinders