Third-Party Research & Development
Technical Discourse

Extracting Static and Dynamic Information From Sin-Cos Hallpot® Resolvers:The ATAN2 Function

John R. Potts, Senior Scientist/Engineering Manager

BRIEF
Elweco Inc. (Painesville, OH) manufactures and markets rotary transducers based on the Hall Effect. Essentially, two basic types of calibrated transducers are available: (1) directly coupled Hallpot® Angle Sensors, for precise system control and/or measurements of angular displacements over restricted ranges (+/- 30 degrees) and (2) directly coupled Sin-COs Hallpot® Resolvers, for precise system control and/or measurements of angular displacements over unrestricted ranges (+/- 360 degrees or more). This paper discusses methods, based on the application of atan2 function, for determining shaft position, rotational direction, counting shaft revolutions, determining shaft speed, and determining shaft acceleration for a Sin-COs Hallpot® Resolver. In this paper, isothermal behavior is assumed. Thermal effects are discussed in Temperature Behavior of Hallpot® Angle Sensors and Sin-COs Hallpot® Resolvers, published on this website.
Techniques for extracting information from Hallpot® Angle Sensors are discussed in Extracting Static and Dynamic Information From Hallpot® Angle Sensors:Linear & Sinusoidal Sensors.

Third-Party Research & Development fabricates and markets diagnostic systems based on RVDT and HallPot® rotary sensors. IDRA® Ballistometer System, which is used in cosmetic claims testing, uses a HallPot® Angle sensor and dynamically assesses and is applied to monitor changes in several mechanical properties of skin and other soft materials. Third-Party R&D also provides custom hardware and software engineering development support services for HallPot® sensors.

ATAN2 FUNCTION
Atan2 is a transcendental mathematical function which provides linear analogs of angular displacements, from coordinate pairs. The usual syntax is atan2(x, y), where x is the x coordinate and y the y coordinate of a point in a plane. Atan2 is the angle from the x axis to a line containing the point and the origin (0, 0). The tangent of atan2(x, y) is equal to y/x, as shown by the tabulated data in Figure 1. By processing the ratio of the coordinates, atan2 function minimizes and/or completely eliminates many types of measurement errors and, therefore, is the function of choice for extracting dynamic information in applications that use a Sin-COs Hallpot® Resolver. The atan2 function is evaluated at various shaft angles using the corresponding Sin-COs Hallpot® Resolver outputs expressed as point coordinates:

Atan2 (-1*(Vcos-Ebocos)/Vpcos, -1*(Vsin-Ebosin)/Vpsin) [1]

Where, the in-phase and quadrature output responses have the basic defining equations Vsin=Ebosin+Vpsin*sin(angle) and Vcos=Ebocos+Vpcos*cos(angle), respectively. Multiplying by -1 moves the point of reference -180 degrees, for convenience in plotting. If Atan2 values of [1] are expressed in radians, multiplying by 180/pi and adding 180 gives the absolute shaft angle in degrees, with respect to the rotary sensor system. Incidentally, the sensor housing can be rotated, with the shaft held at a fixed position in the rotational plane, to change alignment of the sensor system. Ebosin and Ebocos are offsets and Vpsin and Vpcos are slopes and are generally known for calibrated sensors. If offsets and slopes are unknown, they can be easily determined. Averaging the minimum and maximum voltages, at both the in-phase and quadrature sensor outputs, provides reasonable estimates for Ebosin and Ebocos, respectively. Estimates for Vpsin and Vpcos are provided by dividing the differences between those respective minimum and maximum output voltages by 2. Overall, the highest precision is achieved by using offsets and slopes, in evaluations of atan2 function, which have been determined from least squares fits of the Sin-COs Hallpot® Resolver in-phase and quadrature outputs to their basic defining equations.

DETERMINING ABSOLUTE POSITION
Atan2 function is generally evaluated in radians and multiplying the result of [1] by 180/pi and adding 180 gives the absolute angle of the shaft position in degrees. Graphically, a plot of atan2 versus angular displacement is expected to be linear and usually is, as shown in Chart 1. The steep horizontal line at 360 degrees is simply an artifact of plotting, i.e., the return of the pen to its start value. This artifact actually serves as a visual aid for counting revolutions, as shown in Chart 2. In Chart 1, atan2 values are seen to uniquely define angular position over virtually the full range of 360 degrees. That is, for each sensor output couple (Vsin, Vcos), the corresponding angular displacement of the sensor shaft can be accurately determined either from a simple algebraic calculation whereby an atan2 value of [1] is multiplied by 180/pi and the resultant added to 180, from a plot of Angle vs. atan2 or by evaluating a formula developed with atan2 as the independent variable and the displacement Angle as the dependent variable, using linear regression analysis.


DETERMINING ROTATIONAL DIRECTION
As shown in Chart 1, a positive increase in Atan2 indicates a counterclockwise change in direction; a negative increase indicates a clockwise change in direction.

COUNTING REVOLUTIONS
Counting shaft revolutions amounts to monitoring changes in absolute position and direction of rotation, with time. Chart 2 shows a plot of atan2 vs. absolute angular travel. Absolute angular travel is simply defined as the accumulative angle through which the shaft has been rotated, independent of direction. In this particular case, a shaft was rotated 720 degrees in a counterclockwise direction and then rotated an additional 360 degrees in a clockwise direction. Notice that at 360 degrees the atan2 value is identical to that at 0 degrees. The sudden change in the sign of atan2 and resultant vertical line drawn in Chart 2, are useful markers that indicate one complete shaft rotation, i.e., a revolution. Of course, atan2 decreases when the direction of the shaft is reversed, as was already discussed, which is indicated by change in slope of the curve in Chart 2.
Similar behavior is expected for plots of atan2 versus time.

DETERMINING SHAFT SPEED
Accurate real-time determinations of the shaft speed of a rotating resolver requires that both its in-phase and quadrature output voltages are sampled at an adequate rate. Within the sampling time interval, the atan2 function must also be evaluated and used to calculate an instantaneous shaft position, i.e., absolute shaft angular displacement at the particular sampling time. A change in the determined angular displacement, for successive samples, divided by the sampling time interval is a measure of the angular speed during that interval. If the sampling time interval is sufficiently small, then the angular speed calculated will be an accurate approximation of the instantaneous shaft speed.

DETERMINING SHAFT ACCELERATION
Determining shaft acceleration is similar to the problem of determining shaft speed, since it also requires adequate data sampling and an accurate estimate of shaft position. If the sampling time interval is sufficiently small, then calculation of the acceleration, i.e., the change in angular speed between two successive time intervals divided by the time interval, will be an accurate approximation of the instantaneous shaft acceleration.

Acknowledgment: Sin-Cos Hallpot® used to generate Charts 1 and 2 data was provided by John Wereb of Elweco, Inc.
IDRA® is registered to John Potts and Third-Party Research & Development,
Hallpot® Angle Sensor and.Sin-Cos Hallpot® Resolver are registered to Elweco, Inc.