With a peak calibrated plus lookup table hybrid system, bipolar sensor data is first normalized to ±1 for use with the arctan2 (two sensors) or arcsin (one sensor) function to determine a preliminary angle (Ap). Arctan2 must be used instead of arctan because arctan2 accounts for which of the two values are negative. Then the calculated Ap for various known ideal angles (Ai) are recorded as calibration angles (Ac), and a linear error adjustment is done to all future Ap based on the error between the recorded Ac and the known Ai. The process for calibration is:
- Find Ap by inputting the normalized data into the arctan2 or arcsin function, as outlined in Section 4.2.1.1).
- Rotate the magnet to the 0° point and use this Ap as a zero-offset for all other Ap calculations.
- Rotate the magnet to the desired calibration Ai and record the Ap as Ac. (The Ac for 0° is 0° because of the zero-offset adjustment done previously).
- Then, during normal operation, each new Ap falls between two of the previously recorded Ac; the angle just above Ap (AcA) and the angle just below Ap (AcB).
- The error for any point between AcA and AcB is estimated from a linear approximation of the known error from AcA to AiA and Acb to AiB in the form of y = Mx + b, where:
Equation 6.
- Then, all new angle values (An) can be calculated using Equation 7:
Equation 7.