Patent ID: 8335659

Claim:
A computer-implemented method for detecting a position of a magnet system, the method comprising: measuring, at a position sensor, a magnetic flux of a magnetic field in a first direction that is produced by a magnet system and measuring, at the position sensor, a magnetic flux of a magnetic field in a second direction that is produced by the magnet system, where the first direction and the second direction are different directions; determining, with a controller, a first offset based on a first measured maximum flux value, a second measured maximum flux value, and a measured minimum flux value associated with the measured magnetic flux in the first direction and a first reference maximum flux value, a second reference maximum flux value and a reference minimum flux value associated with the magnetic flux in the first direction; determining, with the controller, a first gain based on the first offset, one of the first measured maximum flux value and the second measured maximum flux value, and one of the first reference maximum flux value and the second reference maximum flux value associated with the magnetic flux in the first direction, or based on the first offset, the measured minimum flux value, and the reference minimum flux value associated with the magnetic flux in the first direction; adjusting, with the controller, at least a portion of the values of the measured magnetic flux in the first direction based on the first gain and the first offset, where the adjustment occurs at at least one of a zero crossing associated with the magnetic flux in the first direction and a zero crossing associated with the magnetic flux in the second direction; determining, with the controller, a second offset based on a measured maximum flux value and a measured minimum flux value associated with the measured magnetic flux in the second direction and a reference maximum flux value and a reference minimum flux value associated with the magnetic flux in the second direction; determining, with the controller, a second gain based on the second offset, the measured maximum flux value, and the reference maximum flux value associated with the magnetic flux in the second direction, or based on the second offset, the measured minimum flux value, and the reference minimum flux value associated with the magnetic flux in the second direction; adjusting, with the controller, at least a portion of the values of the measured magnetic flux in the second direction based on the second gain and the second offset, where the adjustment occurs at at least one of a zero crossing associated with the magnetic flux in the first direction and a zero crossing associated with the magnetic flux in the second direction; and determining, with the controller, a position of the magnet system with respect to the position sensor at a given time based on the adjusted values of the measured magnetic flux in the first direction and the adjusted values of the measured magnetic flux in the second direction.