This paper proposes a compensation algorithm for the analog rotor position errors caused by nonideal sinusoidal encoder output signals including offset and gain errors. In order to achieve a much higher resolution, position sensors such as resolvers or incremental encoders can be replaced by sinusoidal encoders. In practice, however, the periodic ripples related to the analog rotor position are generated by the offset and gain errors between the sine and cosine output signals of sinusoidal encoders. In this paper, the effects of offset and gain errors are easily analyzed by applying the concept of a rotating coordinate system based on the
dq
transformation method. The synchronous
d
axis signal component is used directly to detect the amplitude of the offset and gain errors for the proposed compensator. As a result, the offset and gain errors can be well corrected by three integrators located on the synchronous
d
axis component. In addition, the proposed algorithm does not require any additional hardware and can be easily implemented by a simple integral operation. The effectiveness of the proposed algorithm is verified through several experimental results.
I. INTRODUCTION
In precision industrial applications, the use of sinusoidal encoders has been progressively increasing. In order to obtain greater accuracy and higher resolution from AC servo drive systems, it is necessary to acquire precise rotor position information in the related systems. In fact, this is considered to be one of the most important criterions. However, the cost of an incremental rotary encoder overwhelmingly increases depending on its resolution. On the other hand, a sinusoidal encoder can provide high resolution and high accuracy for high performance applications and at a low price when compared to incremental rotary encoders
[1]

[12]
.
The output signals of sinusoidal encoders are a pair of quadrature sine and cosine signals generated as the shaft is rotated. The position information from sinusoidal encoders can be calculated with several techniques
[1]

[12]
. Typically, the position information of sinusoidal encoder based systems can be obtained by a combination of the standard counting techniques associated with encoder interface circuitry and additional information provided by arctangent computation
[2]

[6]
.
However, the sinusoidal encoder itself has errors such as amplitude ratio errors, asymmetry errors, and phase errors
[7]
. In addition, the signal conditioning circuitry of a sinusoidal encoder can cause offset and gain errors due to the nonlinearity of analog devices such as analogtodigital (A/D) converters and OpAmps
[2]

[6]
. Generally, sinusoidal encoder output signals have a low voltage output. Therefore, preconditioning circuits for the input range of the A/D converter are necessary to adjust the output signals. As a result, the offset and gain errors may depend on the designed circuits and the operation conditions.
There are several approaches which have been described as either hardware or software methods
[1]

[3]
,
[5]
,
[8]
. In
[1]
, digitized samples of sinusoidal encoder signals and the output of a divide by four counter circuit were used as an external trigger signal for updating the angular readings. The gain and offset errors can be calibrated by analyzing a large number of random measurements to determine the minimum and maximum values. The method in
[2]
uses an offline compensation method for the offset and gain errors using additional hardware circuits such as a digitaltoanalog converter and OpAmps.
[3]
presents a code compensation method based on phaseencoding. The code errors from a sinusoidal encoder are measured through a calibration procedure. The code error itself can be the compensation quantity for the correspondent phase code. In
[5]
, using the integral operation method to detect the offset and gain errors under the steady state is proposed by the authors.
[8]
shows a geometry method based on a lissajous curve. This method requires a fixed mechanical installation to perform the sampling of the sine and cosine signals.
This paper presents a new compensation algorithm for the analog rotor position errors between the sine and cosine signals of a sinusoidal encoder. Due to the offset and gain errors of the sinusoidal encoder output signals, the synchronous
d
axis components transformed by using the transformation matrix with the analog rotor position have sine and cosine waveforms, which are once and twice the fundamental frequencies of the analog sine and cosine signals. Therefore, the synchronous
d
axis component is used directly for the input signal of the proposed compensator to detect the offset and gain errors. The offset and gain errors can be estimated by the integral operations of the synchronous
d
axis components. As a result, the proposed algorithm can be easily implemented and the offset and gain errors can be simply detected by using the integral operation of the synchronous
d
axis components. The usefulness and effectiveness of the proposed method are verified through several experimental results.
II. REVIEW OF OFFSET AND GAIN ERRORS IN SINUSOIDAL ENCODER OUTPUT SIGNALS
 A. Signal Processing of Sinusoidal Encoders
A typical signal processing method for the sinusoidal encoder used in this paper is shown in
Fig. 1
[2]
,
[5]
,
[6]
. The sinusoidal encoder encodes the position information by providing a pair of quadrature sine and cosine signals as the shaft is rotated. In order to obtain precision position information, a certain amount of preconditioning of the analog signals must be implemented. In
Fig. 1
, the sine and cosine analog signals,
U
_{sin}
and
U
_{cos}
, are digitalized by the A/D converters and the analog signal conditioning circuits. Then, the sine and cosine output signals of the sinusoidal encoder can be converted to square waves by using each comparator. The square wave signals are typically applied to define the analog rotor position,
θ
according to the specific sections. As a result, the rotor position must be constructed from digital and analog rotor position information, as shown in
Fig. 1
.
Typical signal processing interface of sinusoidal encoder.
Under the assumption that the sinusoidal encoder output signals are truly sinusoidal, the output signals of the sinusoidal encoder,
U
_{sin}
and
U
_{cos}
, can be expressed as:
where
U_{s}
and
U_{c}
are the amplitudes of the analog output signals of the sinusoidal encoder.
θ
is the actual analog rotor position of the incremental output signals.
The analog rotor position based on the arctangent algorithm can be derived by
[2]
,
[5]
,
[6]
.
By using
θ
of (3) and the counted numbers of
U
_{sin}
and
U
_{cos}
in
Fig. 1
, the mechanical rotor position can be obtained by:
where
M
is the resolution per revolution of the sinusoidal encoder,
N
is the counted number during the sampling period, and
θ_{m}
is the mechanical rotor position.
The mechanical rotor position from the sinusoidal encoder can be calculated by a digital signal processor (DSP), as shown in
Fig. 1
.
 B. Nonideal Characteristics in the Signal Processing Circuits
Fig. 2
shows the typical analog signal path and the error factors related to the sinusoidal encoder signal processing. Generally, the sine and cosine signals of a sinusoidal encoder have a 1V
_{pp}
output voltage range. Therefore, the analog signals need to be converted to match the input range of an A/D converter through matching circuits and lowpass filters, as shown in
Fig. 2
. During this process, the offset and gain errors in the signal processing circuits may be caused by the sinusoidal encoder itself due to errors such as the amplitude ratio error, the asymmetry error, the nonlinearity of the A/D converter, and the nonideal characteristics of the analog devices. As a result, the analog rotor position can be distorted by these errors.
Error factors for processing incremental analog signals of sinusoidal encoder.
 C. Signal Processing without Offset and Gain Errors
Fig. 3
shows a block diagram of the tracking loop to extract precise analog rotor position information from the sinusoidal encoder signals
[6]
. This method is similar to the ones used in hardware solutions for getting rotor position information from the resolver using a resolvertodigital converter
[13]
,
[14]
.
In
Fig. 3
, the output signals of the sinusoidal encoder,
U
_{sin}
and
U
_{cos}
, can be derived as follows:
where
U_{p}
is the adjusted amplitude of the sinusoidal encoder output signals for the input range of an A/D converter.
The two inputs (5) and (6) are multiplied by cos
ϕ
and sin
ϕ
in the tracking loop, respectively. The resulting signals can be expressed as:
where
ϕ
is the estimated analog rotor position from the tracking loop.
From C in
Fig. 3
, the error component between the two output signals,
E_{err}
, can be calculated by:
Finally, the error component
E_{err}
is forced to zero by changing
ϕ
recursively to track the actual analog rotor position
θ
in the tracking loop, as shown in D of
Fig. 3
. This method tracks the analog rotor position and periodically updates a position counter.
Block diagram of tracking loop for sinusoidal encoder.
 D. Analysis of the Offset and Gain Errors
The analog signal path of a sinusoidal encoder may include offset and gain errors because the analog output signals of a sinusoidal encoder are converted to digital values through a matching circuit, lowpass filters, and an A/D converter, as shown in
Fig. 2
. The output signals of the sinusoidal encoder,
U_{s_err}
and
U_{c_err}
, including the offset and gain errors can be expressed by:
where Δ
_{s}
and Δ
_{c}
are the amplitudes of the offset errors between the sine and cosine signals, and
α
and
β
are the amplitudes of the gain errors between the sine and cosine signals.
From (10) and (11), the multiplied output signals of the sinusoidal encoder can be represented as:
Hence, the error between the sinusoidal encoder output signals can be derived as:
From (14), when the error component is forced to zero, the above equation can be expressed as follows:
In addition, when the offset and gain errors are small, the analog rotor position error is also small which implies that (
θ

ϕ
) =
θ_{err}
. Using the approximation with (16), (15) can be rewritten as (17).
As can be seen from (17), the analog rotor position error caused by the offset and gain errors is composed of sine and cosine terms with once and twice the analog rotor position, respectively. As a result, the resolution of the sinusoidal encoder can definitely be reduced due to the distorted analog rotor position.
 E. Effect of the Offset and Gain Errors in the Synchronous dqaxis Components Using the Transformation Matrix
As mentioned above, the sine and cosine output signals of the sinusoidal encoder are basically displaced from each other by 90°. Therefore, the sine and cosine signals,
U
_{sin}
and
U
_{cos}
, can be expressed as
dq
axis variables in the stationary reference frame as (18) and (19).
In this case, the synchronous dqaxis components including the offset and gain errors can be derived by using Park’s transformation as:
where
is the estimated analog rotor position from the incremental analog signals.
As a result, the synchronous
dq
axis components including the offset and gain errors can be obtained by:
As can be seen from (21) and (22), the synchronous
dq
axis components consist of sine and cosine terms with once and twice the analog rotor position including the offset and gain errors.
III. PROPOSED COMPENSATION ALGORITHM
 A. Proposed detection method of offset and gain errors using the synchronous daxis component
Fig. 4
shows a block diagram of the proposed compensator using the s ynchronous
d
axis component after a transformation between the sine and cosine signals of the sinusoidal encoder. In
Fig. 4
,
is the
d
axis reference component,
is the estimated analog rotor position, and
is the synchronous
d
axis component. The offset and gain errors are compensated by the integration operation of the synchronous
d
axis component, as shown in
Fig. 4
. As can be seen from (21), the synchronous
d
axis component has sine and cosine terms of once and twice the fundamental frequencies of the sinusoidal encoder output signals. Therefore, the offset and gain errors can be compensated by suppressing the ripple components of the synchronous
d
axis component using integral (I) controllers, as shown in
Fig. 4
. However, the proposed algorithm cannot detect the amplitude of the offset and gain errors in the synchronous
d
axis component under standstill operation.
Block diagram of proposed compensator using synchronous daxis component.
 B. Detection Process of Offset Errors Using the Synchronous Daxis Component
Fig. 5
shows the integral operation of the synchronous
d
axis component caused by the offset errors. From (21), the synchronous
d
axis component due to the offset errors, Δ
_{s}
and Δ
_{c}
, consists of sine and cosine terms with the fundamental frequency of the analog rotor position. As shown in
Figs. 5
(a) and (b), the integral results,
ε
_{Δs}
and
ε
_{Δc}
, can be easily obtained by integrating the sine and cosine terms according to the analog rotor position, respectively.
In case of the offset errors, integral operation process according to analog rotor position. (a) integration result of the cosine term. (b) integration result of the sine term.
ε
_{Δs}
can be acquired by integrating the synchronous
d
axis component from
π
/2 to 3
π
/2 as in (23).
During this process, the cosine term of the synchronous
d
axis component is automatically removed by the integrating operation, as shown in
Fig. 5
(a).
ε
_{Δc}
can be acquired simply by integrating from 0 to
π
, as shown in
Fig. 5
(b).
 C. Detection Process of Gain Errors Using the Synchronous Daxis Component
Fig. 6
shows the integral operation of the synchronous
d
axis component caused by the gain errors. From (21), the synchronous
d
axis component, because of the gain errors, has a sine term with two times the analog rotor position. As shown in
Fig. 6
, the integral result,
ε_{gain}
, can be calculated by integrating the sine term of the synchronous
d
axis component from 0 to
π
/2.
In case of the gain errors, integral operation process and integral result according to analog rotor position.
 D. Implementation of the Proposed Compensation Algorithm
Fig. 7
shows an overall block diagram of a PMSM drive with the proposed compensator. The proposed compensator consists of three integral (I) controllers, the transformation matrix, and the synchronous
d
axis component, as shown in the rectangular box of
Fig. 7
.
Block diagram of the PMSM drive with the proposed compensator and the sinusoidal encoder.
The integrators are used for detecting the offset and gain errors in the synchronous daxis components according to the estimated analog rotor position. Three integral (I) controllers are applied to track the offset and gain errors. The compensation operation is performed by subtracting the calculated error components from the measured analog signals, as shown in
Fig. 7
. Therefore, the proposed algorithm does not need any hardware circuits and it is easily implemented by software using the integral controllers and the transformation matrix. Moreover, the structure of the proposed compensator is very simple and it requires less computational effort.
IV. EXPERIMENTAL RESULTS
The proposed compensation method was implemented on a PMSM drive with a DSP based system, as shown in
Fig. 8
.
Fig. 8
shows the overall experimental setup with a sinusoidal encoder and an incremental encoder. The sinusoidal encoder (ERN 1387) is mounted on the motor shaft. The sinusoidal encoder outputs incremental sin/cosine analog signals with 2048 periods and absolute sin/cosine signals of one cycle per revolution
[15]
. The proposed algorithm for compensating the offset and gain errors of the incremental sin/cosine analog signals is verified under several operation conditions.
Overall experimental setup for the sinusoidal encoder interface.
Fig. 9
shows the designed signal conditioning board for the sinusoidal encoder. The designed board basically consists of matching circuits, lowpass filters, comparators, and an A/D converter to deal with the incremental and absolute analog signals
[2]
,
[5]
.
Designed signal conditioning board for the sinusoidal encoder.
Figs. 10
and
11
show the experimental results of the sine and cosine analog signals, the analog rotor position, the synchronous
d
axis component, and the FFT results according to the offset and gain errors when the motor is operated at 1 r/min.
Experimental results of sine and cosine analog output signals, analog rotor position, synchronous daxis component, and FFT results (1 r/min). (a) sine and cosine analog output signals, analog rotor position, and synchronous daxis component including offset errors. (b) without the proposed compensation algorithm. (c) with the proposed compensation algorithm.
In
Fig. 10
, the offset errors of the sine and cosine signals are Δ
_{s}
= 0.3 and Δ
_{c}
= 0.3, respectively. Without the compensation algorithm, the synchronous
d
axis component has a ripple with the fundamental frequency of the analog rotor position, as shown in
Fig. 10
(b). After compensation, the ripple of the synchronous daxis component is decreased, as shown in
Fig. 10
(c).
Fig. 11
shows the experimental results according to the gain errors
α
= 0.1 and
β
= 0.1, respectively. As can be seen from
Fig. 11
(a), the analog rotor position is seriously distorted due to the gain errors between the sine and cosine output signals.
Experimental results of sine and cosine analog output signals, analog rotor position, synchronous daxis component, and FFT results (1 r/min). (a) sine and cosine analog output signals, analog rotor position, and synchronous daxis component including gain errors. (b) without the proposed compensation algorithm. (c) with the proposed compensation algorithm.
Without the proposed compensation algorithm, the synchronous
d
axis component has two times the ripple of the fundamental frequency of the analog rotor position, as shown in
Fig. 11
(b). After applying the compensation method, the distorted analog rotor position is removed and the twice the ripple of the synchronous
d
axis component is significantly reduced to zero, as shown in
Fig. 11
(c).
Fig. 12
shows the experimental results including the offset and gain errors. Even though the offset and gain errors exist together, the ripple components in the synchronous
d
axis component are effectively reduced by the proposed algorithm, as shown in
Fig. 12
.
Experimental results of sine and cosine analog output signals, analog rotor position, synchronous daxis component, and FFT results (1 r/min). (a) sine and cosine analog output signals, analog rotor position, and synchronous daxis component including offset and gain errors. (b) without the proposed compensation algorithm. (c) with the proposed compensation algorithm.
Fig. 13
and
14
show the operation characteristics of the proposed compensation algorithm according to changes in the offset and gain errors. In
Fig. 13
(a), the offset errors of the sine signal are changed from 0.1 to 0.2. The offset errors can be well tracked by the proposed compensation algorithm. The control performance, according to variations of the offset errors in the cosine signals, is shown in
Fig. 13
(b). Moreover,
Fig. 14
shows the convergence results according to changes in the gain errors. Despite the changes in the gain errors, the gain errors are certainly estimated by using the proposed algorithm and the ripple of the synchronous
d
axis component is also reduced, as shown in
Fig. 14
.
Experimental results of synchronous daxis component and estimated offset error according to change of offset error (1 r/min). (a) operation characteristics according to the sine term including offset error. (b) operation characteristics according to the cosine term including offset error.
Experimental results of synchronous daxis component and estimated gain error according to change of gain error (1 r/min).
Fig. 15
shows the operation characteristics of the proposed compensation algorithm according to the compensation process. Firstly, the offset errors can be compensated by the proposed algorithm, as shown in
Fig. 15
. After that, the compensation process for the gain errors is started. With the proposed compensation algorithm, the offset and gain errors can be well tracked and the ripple of the synchronous
d
axis component is decreased, as shown in
Fig. 15
.
Experimental results of synchronous daxis component and estimated offset and gain errors according to variation of offset and gain errors (1 r/min).
V. CONCLUSIONS
In precise AC motor drives using sinusoidal encoders, periodic analog rotor position errors which have once and twice the ripples of the analog rotor position are caused by the offset and gain errors between the sinusoidal encoder output signals. Due to the effects of the analog rotor position errors, the analog rotor position resolution of motor drives is definitely degraded. In this paper, the effects of the nonidealanalog output signals of a sinusoidal encoder were analyzed on the basis of the synchronous daxis component by applying the transformation matrix. The synchronous daxis component was used for the input signal of the proposed algorithm in order to estimate the analog position errors of the sinusoidal encoder by using an integral operation. The magnitude of the gain and offset errors can be directly detected by the integral operation of the synchronous daxis component between specific sections according to the estimated analog rotor position. Therefore, the proposed algorithm is easily implemented by simple mathematic calculations and integral operations without external hardware circuits. The effectiveness of the proposed method is verified through experimental results.
Acknowledgements
This work was supported by the National Research Foundation of Korea(NRF) grant funded by the Korea government. (No. 2012026153)
BIO
SeonHwan Hwang was born in Chungnam, Korea, in 1978. He received his B.S., M.S., and Ph.D. degrees in Electrical Engineering from Pusan National University, Busan, Korea, in 2004, 2006, and 2011, respectively. From 2011 to 2012, he was with the Center for Advanced Power Systems (CAPS), Florida State University, Tallahassee, FL, USA. In 2012, he joined the Department of Electrical Engineering, Kyungnam University, Changwon, Korea. His current research interests include the control of electrical machines, power electronics, and wind power generation systems.
DongYoun Kim was born in Ulsan, Korea, in 1983. He received his B.S. and M.S. degrees in Electrical Engineering from Pusan National University, Busan, Korea, in 2011 and 2013, respectively, where he is currently working toward his Ph.D. degree His current research interests include power conversion, electric machine drives, and electrical vehicle propulsion.
JangMok Kim received his B.S. degree from Pusan National University (PNU), Busan, Korea, in 1988, and his M.S. and Ph.D. degrees from the Department of Electrical Engineering, Seoul National University, Seoul, Korea, in 1991 and 1996, respectively. From 1997 to 2000, he was a Senior Research Engineer with the Korea Electrical Power Research Institute (KEPRI), Daejeon, Korea. Since 2001, he has been with the School of Electrical Engineering, PNU, where he is currently a Research Member of the Research Institute of Computer Information and Communication, a Faculty Member, and a Head of the LG Electronics Smart Control Center. As a Visiting Scholar, he joined the Center for Advanced Power Systems (CAPS), Florida State University, Tallahassee, FL, in 2007. His current research interests include the control of electric machines, electric vehicle propulsion, and power quality.
DoHyun Jang received his B.S. degree in Electrical Engineering from Hanyang University, Seoul, Korea, in 1980, and his M.S. and Ph.D. degrees from Seoul National University, Seoul, Korea, in 1982 and 1989, respectively. Since 1985, he has been with the Department of Electrical Engineering, Hoseo University, Chungnam, Korea, where he is currently a Professor. From 1993 to 1994, he was a Visiting Scholar in the Department of Electrical Engineering, Texas A&M University, College Station, TX. His current research interests include ac motor speed control, switched reluctance motor drives, and twophase induction motor drives.
Hagiwara N.
,
Suzuki Y.
,
Murase H.
1992
“A method of improving the resolution and accuracy of rotary encoders using a code compensation technique”
IEEE Trans. Instrum. Meas.
41
(1)
98 
101
DOI : 10.1109/19.126640
Kim J. C.
,
Hwang S. H.
,
Kim J. M.
,
Kim C. U.
,
Choi C.
2006
“Ultra precise position estimation of servomotor using analog quadrature encoder”
Journal of Power Electronics
6
(2)
139 
145
Kavanagh R. C.
2001
“Probabilistic learning technique for improved accuracy of sinusoidal encoders”
IEEE Trans. Ind. Electron.
48
(3)
673 
681
DOI : 10.1109/41.925595
2000
Application Note, Closed Loop Position Estimation with Signal Compensation for Sinusoidal Encoders with ADMC401
Analog Devices Inc.
Hwang S. H.
,
Lee J. H.
,
Kim J. M.
,
Choi C.
2010
“Compensation of analog rotor position errors due to nonideal sinusoidal encoder output signals,”
Energy Conversion Congress and Exposition (ECCE), 2010 IEEE
4469 
4473
Burke J.
,
Moynihan J. F.
,
Unterkofler K.
2000
“Extraction of high resolution position information from sinusoidal encoders,” Technical report
Analog Devices
Yien C.
1992
“Incremental encoder errors: Causes and methods to reduce them,”
in Proc. PCIM’92
110 
121
Xiao K.
,
Wang L.
2009
“Analysis and error compensation of electric sine/cosine encoder”
The Ninth International Conference on Electronic Measurement & Instruments, ICEMI’2009
Mayer J. R. R.
1994
“Highresolution of rotary encoder analog quadrature signals”
IEEE Trans. Instrum. Meas.
43
(3)
494 
498
DOI : 10.1109/19.293478
Tan K. K.
,
Zhou H. X.
,
Lee T. H.
2002
“New interpolation method for quadrature encoder signals”
IEEE Trans. Instrum. Meas.
51
(5)
1073 
1079
DOI : 10.1109/TIM.2002.806028
Hong X.
,
Lu Z.
2009
“A novel scaling method for sinusoidal quadrature encoder”
IEEE 6th International Power Electronic and Motion Control Conference
826 
829
Benbrahim L.
,
Benammar M.
,
Alhamadi M. A.
2006
“A novel converter for sinusoidal encoders”
IEEE SENSORS Proceedings
1415 
1418
Hwang S. H.
,
Kim H. J.
,
Kim J. M.
,
Liu L.
,
Li H.
2011
“Compensation of amplitude imbalance and imperfect quadrature in resolver signals for PMSM drives”
IEEE Trans. Ind. Application.
47
(1)
134 
143
DOI : 10.1109/TIA.2010.2091477
Hwang S. H.
,
Kwon Y. H.
,
Kim J. M.
,
Oh J. S.
2009
“Compensation of position error due to amplitude imbalance in resolver signals”
Journal of Power Electronics
9
(5)
748 
756
Heidenhain Co.
2006
“ERN 1387 Datasheet”