A new linear position sensor (Micrus) has been developed, based on the transmission of ultrasonic signals in a waveguide. Waves are generated at the cursor position by the magnetostrictive effect, and their times of flight to the ends of the waveguide are used to estimate the position of the mobile element. The choice of the generating/transmitting metal for this kind of sensor is discussed. We have found that the magnetic hysteresis inherent to the magnetostrictive phenomenon translates into measurement hysteresis, affecting the performance of the sensor. An explanation of the link between both effects is given, and a compensation technique based in focusing the ultrasonic generation is offered. This compensation technique is tested using an electromagnetic finite element method program and then empirically in the Micrus sensor, with satisfactory results.