Calculates the position of the magnet from the output of the hall effect sensor, using the known current. Additionally, the velocity of the magnet is determined by differentiating the position. A time discrete differentiation is used.