You are on page 1of 6

Instantaneous Speed and Disturbance Torque Observer using Nonlinearity

Cancellation of Shaft Encoder


J. Corres, P. Gil
Public University of Navarre, Dept. of Electric and Electronics Engineering
Campus Arrosadia sln. 3 1006 Pamplona. Spain
Email: jmcorres@unavarra.es

AbstrPct- In this paper the theoretical analysis, simulations to the transitions as possible in order to cancel the
and practical results of a new speed and disturbance torque quantization, but as it cannot be completely suppressed due
observer are proposed. The analysis of the nonlinearity to hardware limitations, the residual measurement noise is
introduced by the encoder quantization allows improving the incorporated to the optimal observer gain calculation.
behaviour of the fdter in all the speed range. A Kalman fdter This filter can be viewed as an asynchronous multirate
type observer has been developed. The main novelty is that the
state estimate observational update takes place at the observer executed periodically, without the need to use
quantized position signal discontinuities. Unlike the usually interrupts that makes the implementation difficult. The
applied Kalman fdter, the measurement noise covariance is discrete time Kalman Filter equations are updated in virtual
variable. In this observer, it is a function of the shaft speed sampling instants characterized by their best noise
because the selection of the sampling instant results in a measurement properties. This is a simple method to take
reduction of the output noise covariance. The observer adapts advantage of all the information provided by the position
its gain depending on the state variables. The optimal gain transducer. Its implementation only requires an additional
calculation results in an observer bandwidth increase. counter and two-plant discretization every period. The
Another advantage of this observer is that the self-sustained
observer bandwidth increase can be up to ten times higher
oscillations are suppressed, obtaining asymptotic stability.
in our case.
I. INTRODUCTION Robust performance with inertia variations has been
extensively studied [l 11 [ 121. In this study, we suppose that
The encoder is the position transducer most widely used the inertia remains constant or that its variations can be
in industrial applications. The speed regulation on a wide identified fast enough.
range is fundamental in the drives control for industrial
applications as tool machines, robots or electrical vehicles. 11. THEMECHANICAL
MODEL
The ordinary control uses the information of the average
speed [1] for feedback. However, when a low-resolution The model of the mechanical part in Fig. 1 is the
encoder is used, a delay that causes instability in the classical third order state space model. The disturbance
feedback loop compels to decrease the controller gain. torque includes all type of external torques, including
Speed and disturbance torque observers have become an viscous fiiction. If friction torque model exists, it can be
included. The motor torque of the field oriented controlled
effective technique of calculating the instantaneous speed
using Luenberger-type observers [lo] [2] [3] or Kalman induction motor is
Filters [8] [9].
When the elapsed time between encoder pulses is very
large, the filter applied in its standard form can cause
oscillations in steady state. A projection observer that is run
at the instants in which the transitions of the quantized
output occurs was developed in [5]; it is in those instants I Tdis
when the measurement is fkee of quantization noise. It is
possible to reduce the quantization effect by reducing the
filter bandwidth at low speed, however it is difficult to tune
it correctly for a wide speed range and assure the observer
stability. In [6] Sakai attempted to improve the behaviour at
low speed adding static fiiction compensation to the Tm
observer. Yang [7] used an interpolation method of the
position using the average speed with the drawback that it
introduces an additional delay producing oscillations in the
transient.
In this paper, a new observer whose main property is the
encoder nonlinearity cancellation is proposed. The aim is to
achieve asymptotic stability at very low speed and to
increase the global dynamic performance in all the speed Fig. 1. Mechanical system and observer
range. The observer output equations are updated as close

0 2002 EEE.
0-7803-7262-x/Ml$10.00 540

Authorized licensed use limited to: Reva Institute of Tehnology and Management. Downloaded on December 14, 2008 at 00:31 from IEEE Xplore. Restrictions apply.
State equation of the continuous system:

f = Ax+ Bu + w
y = cx+v
c=(o 1 0)

1) f 1)
-
0 0 -
J" J"
(2)
0 0 0 0
ImC)
Fig. 2. Discrete update of the projection observer
State equation of the discretized system:
x,,, = Akxk+ B,u + wk State estimate extrapolation
y=Cx+v, i=Ai+Bu Vtgt, (5)
A =eATS
State estimate observational update
inw
ti-K(y-y,) V t e tk (6)
where K = M-'CT ( CM-'CT)-I

Dynamic stability is assured maintaining the


(3)
characteristic polynomial roots within unit circle.
IAI - ( I - K C ) AI = 0

B. The discrete Kalman Filter

Although the discrete Kalman Filter (KF) [4] is generally


111. STATEOBSERVERS applied at a constant rate, the projection can be done at any
time by having the precaution of extrapolating the state and
A. The Projection Observer the error covariance matrix correctly. Doing this, the KF
becomes a projection observer similar to the proposed in
The "projection observer" proposed in [ 5 ] can be applied [5], with the additional advantage that the gain filter is
to M M O LTI systems with quantized outputs. The tuned automatically. The general KF algorithm is
objective of this observer is to extract the estimated state reproduced below.
viewing the quantized measurement as a limited
information problem. In spite of the limited information
output, the estimated error tends to zero as t + . - State estimate extrapolation
ik= Aik-' + Bu (7)

In Fig. 2 the state space is the direct sum of Im(CT) and Error covariance extrapolation
N(C). Given a certain positive matrix M the vectors
belonging to the subspace Im(M'CT) are orthogonal to
e = Ak-,pk-,Ak-,T+ GQk-,GT
those of N(C). The orthogonal projection matrix on the
vector subspace N(C) is State estimate observational update
Zk t ik+ K k ( Z k -ak) (9)
(
P = I - M--'CT(CM-'CT ) I c) (4)
Error covariance update

The conditions that are imposed for the new observation


pk = ( I - K ~ C( I)- K
~ ~ +c K), R~, K , ~ (10)
update are two:
Kalman Gain Matrix
C1: The projections on N(C) of the estimated state Kk = pkC/ (CpkC' + Rk) '
before and after the update are the same i.e.
Pinm= P i
The solution is uniformly asymptotically stable, though
C2: The state output is equal to the real output nonlinearities as the quantization introduced by the encoder
i.e. Ci- = Cx or unmodelled aspects can produce instability.

541

Authorized licensed use limited to: Reva Institute of Tehnology and Management. Downloaded on December 14, 2008 at 00:31 from IEEE Xplore. Restrictions apply.
IV.THEPROPOSED
OBSERVER STEP2: MeasurementUpdate
IF (New pulse OR Position error > %lax),
At low speed, the behaviour related to the position in THEN {
stationary state is shown in Fig. 3. The speed and Error covariance update (11).
disturbance torque estimates become oscillatory due to the Kalman Gain Matrix (10)
encoder quantization. The output of the observer grows State estimate observational update (9) 1
quickly after a new pulse arrives, and decays immediately
afterwards to maintain the fixed quantized position, while STEP3: Tz - Extrapolation
the actual position follows a different path. {Discrete Matrix Calculation using T2 (3)
State Estimate Extrapolation (7)
It can be observed the similarity between equations (6) Error covariance Extrapolation (8)}
and (11). The only difference is the presence of
measurement noise. The fundamental idea that underlies A. High-Frequency Counter
this study is that if the delay is sufficiently reduced, the
observer will approach to the projection observer ( R & I ) In the new observer, the time that elapses from the last
eliminating in practice the nonlinearity. This is encoder pulse until the present sampling instant is
accomplished projecting (updating the measurement) near employed to improve the estimate of the states. In order to
the encoder pulses. If there is no output feedback for many measure this time an additional counter is necessary. This
sampling periods, the estimated position can be greater than counter is reset with encoder signal edges and is latched
one encoder line. Then the state estimate is updated with together with the position up/down counter at a constant
the constant position, adjusting the Kalman gain to the period T,. The timer width W must comply with
standard filter one. Each sampling period T, the following is 2w 2 f,T, ; e.g. in simulations a high frequency clock f m
run:
=1.25 MHz is used under a Ts=200 ps sampling period.
STEP1: TI - Extrapolation Therefore, the timer should have at least eight bits. Calling
{DiscreteMatrix Calculation using TI (3) n to the output of the counter, I; = ( N - n )THFit is the time
State Estimate Extrapolation (7) since the previous sampling until the arrival of the last
Error covariance Extrapolation (8) } pulse before the current sampling, and T, = nT, is the time
since the last pulse.

B. Covariance matrix of the measurement noise

In the Standard Kalman Filter employed in [8] and [9], Rk


is a constant usually employed as a design parameter. The
maximum measurement error of the position is the
eest corresponding to an encoder line emm=2dPPR,where PPR
is the number of encoder pulses per revolution. Upon
incorporating the counter information, the maximum error
?moder output

0 . 1

0.2
4 r .
0.22
,

0.24
,

0.26
.
0.28 0.30
,

0.32
1 is reduced to e(@THF)=dHF,preserving the limit
corresponding to the angle of a line e - . Concerning the
distribution of the quantization noise, it has a uniform
time($ distribution with covariance R=ez/12. In Fig. 5 the
dependency of R with the speed, which is recalculated each
Fig. 3. Quantized position measurement Q[O] and observed position, Om time a new pulse amves, is represented.
using the standard Kalman filter
6
IO
Standard Kahnsn Filter f

IO
.I I
I I
0 1 4
10 IO 10
S& Speed (rpm)
Fig. 5. Measurement Covariance (R)vs. shaft speed for several high
Fig. 4. Time magnitudes employed in the proposed observer kquency clock values V;IF)

542

Authorized licensed use limited to: Reva Institute of Tehnology and Management. Downloaded on December 14, 2008 at 00:31 from IEEE Xplore. Restrictions apply.
101 ..................... Fig. 6 and Fig. 7 show how the optimal gain calculation
results in an observer bandwidth increase, which can be up
to ten times higher, depending on the rotational speed.

v. SJMULATIONRESULTS
Simulations using Matlab for different ranges of shaft
speed, contrast the performance of the proposed observer
with the standard one. Speed and disturbance torque
estimates are compared with real variables.
....................
IO1 '01 Frcquecy (radts) lo' 10' TABLE I
SMULATION PARAMETERS

Fig. 6. Bode graph of estimateddisturbance toque (Td CSJTdieol). Total Inertia (Jn): 0.012 Kgm'
Encoder Resolution (PPR): 4096
?{ -
7 Sampling Time (Ts): 200 p
High frequency clock (THF): 833 ns
Disturbance Torque Peak (Tdis) 0.1 N.m

THFhave a strong influence on total simulation time. Te


period employed in this simulation is enough to show the
observer performance and it does not require an excessive
long simulation time (120 seconds). A lower value
improves the performance due to lower measurement noise.
Fig. 8 (a) shows observer performance below 100 rpm.
The proposed filter responds faster to the external
disturbance. In Fig. 8 (b) asymptotic stability can be
observed at very low speed (around lrpm) for both speed
Fig. 7. Bode graph of shaft speed (&Jwm,) and disturbance torque estimates.

0.8

0.6

0.4

0.2

0 0.1 0.2 0.3 0.4 0 0.1 0.2 0.3 0.4

0.15

0.1
P
$ 0.05
P
c - 0 0
8
B

-
f
%
-0.05

5 -0.1

I
0
I

0.1
l

0.2
l

0.3 0.4 0 0.1 0.2 0.3 0.4 0 0.1 0.2 0.3 0.4
1
.
0
..
1
0.1 0.2 0.3 0.4
time (s) time (s) time (s) time (s)
Proposed Filter Standard Filter Proposed Filter Standard Filter
a) Medium speed range , b) Low speed range

Fig. 8. Simulationresults. Real and estimated states.

543

Authorized licensed use limited to: Reva Institute of Tehnology and Management. Downloaded on December 14, 2008 at 00:31 from IEEE Xplore. Restrictions apply.
encoder pulses to "up/down" and "clock" inputs to the first
counter and the reset signal for the second. Synchronization
of the two counters is essential in order to obtain correct
measurements. This configuration allows us to measure the
average speed with the M/T method [13 without the need of
extra logic.
TABLE XI
PRACTICAL hfPLEMENTATION PARAh4ETERS

Totul Inertia Jn 0.012 Kgm' Rs 5.9 a


PPR 40961512 Rr 2.7 a
Ts 200 ps Lm 0.443H
THF 50 ns Ls 0.462 H
No. of poles 4 Lr 0.462 H
Rated Power 1500 W Rated Current 3.4 A
Rated Voltage 380 V

A good average speed is needed for comparison with


estimated speed. A frequency divider reduces the effective
encoder resolution for observers down to 512 PPR, while
the average speed uses the full resolution. In Fig. 10 the
observer gain varies with the shaft speed in the proposed
filter, while the standard one have a lower and constant
gain. Fig. 11 shows the proposed and standard observer
performance in open loop. Disturbance torque of k2 N.m
amplitude is applied periodically during 50 ms aprox by the
vector controlled induction motor acting as a load. In Fig.
11 (b) the estimated torque is compared with a transducer
torque measurement; the difference between them is due to
(b)
the unmeasurable friction torque (about 0.35 N.m). Fig. 12
Fig. 9. Pictures of experimentalsetup (a) 1.5 kW Test-rig (b) DSP based shows an enlargement of speed waveform. As expected the
card proposed observer exhibits a better performance for the
transient (a) and suppressing the undesirable oscillations
caused by the encoder quantization at very low speed.
VI. PRACTICAL
IMPLEMENTATION
AND EXPERIMENTAL
RESULTS.

The observer and vector control algorithm has been


implemented allowing a 200 ps sampling time. Fig. 9
shows two pictures of the experimental setup. The control
of the squirrel cage induction motor was implemented using
a 32-bit digital signal processor (DSP) TMS320C30
running at 40-MHz. A vector coprocessor (AD2S 100) and a 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
PWh4 generator (TH8001) help the DSP with vector
control. The inverter was constructed using an IGBT
intelligent power module (PMRSH120). PWM switching
fiequency was 5 kHz. A 1.5 kW ac motor with 4096 pulses
per revolution (PPR) encoder was used to obtain
experimental results. Table I1 shows the mechanical and
vectorial model parameters. Inertia does not vary; an off-
line Extended Kalman Filter (EKF) (with Jn as an extra
state) was used for its identification. In order to apply the . . . . . . . . . l
load torque, another 1.5 kW ac motor was used. It was
controlled using a commercial vector controller, set in the
speed control mode. 50
Timers and extra logic have been implemented in an s o
ALTERA programmable logic device (PLD). It has a 16-bit -50
0.2 0.4 0.5 0.6 0.7 0.8 0.9
t1
up/down counter (storing the position) and a 12-bit counter 0.1 0.3
time(s)
(storing the time from the last encoder pulse to the present
sampling instant). A state machine converts the quadrature
Fig. 10.Kalman Gains ofproposed and standard filters

544

Authorized licensed use limited to: Reva Institute of Tehnology and Management. Downloaded on December 14, 2008 at 00:31 from IEEE Xplore. Restrictions apply.
[4] M. Grewal, A. Andrews “Kalman Filtering, Theory and practice”.
Prentice Hall, 1993.
[5] J. Sur, B. Paden, “State observer for linear time-invariant systems
with quantized output”. Trans. ASME. Jour. of dynamic systems,
20 measurement and control. Vol120, pp. 423-426
[6] S. Sakai, Y. Hori, “Ultra-low speed control of servomotor using low
resolution rotary encoder”, IECONproc. 1995, p p . 615-620.
15
h [7] S. Yang, S. Ke, “Performance evaluation of a velocity observer for
s accurate velocity estimation of servo motor drives”. U S conj 1998,
110 pp. 1697-1702.
[8] T. J. Kweon, D. S. Hyun, “High-Performance speed control of
z5 electric machine using low precision shaft encoder”. IEEE Trans.
Power Electronics, vol. 15, no 5, Sep. 1999, pp. 838-849
[9] H. W. Kim, S. K. SUI, “A new motor speed estimator using Kalman
filter in low speed range”, IEEE Trans. On Industrial Electronics,
0 Vol. 43, No 4, Aug. 1996 pp. 499-504
[lo] D. G. Luenberger, “An introduction to observers”, IEEE Trans. On
Automatic Control, vol. 16, N”6, 1971, pp. 596-6
-51
0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8
I
0.9
I
1 [ l l ] N. Kim, H. Moon, D. Hyun, “Inertia Identification for the speed
observer of the low speed control of induction Machines”, ZEEE
(a) Estimated Speed and MIT average speed. Trans. On Industry Applications, vol. 32, N”6, 1996, pp. 1371-9
[12] M. Iwasaki, N. Matsui, “Robust speed control of IM with torque
feedfomard control“,IEEE Trans. On Industrial Electronics, vol. 40,
2.5
N”6, 1993, pp. 553-60
2

1.5

2 1

20
0.5
c
i o 18

a
p
0
-05

-1 5

7
-I
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time@) 6
(b) Disturbance torque (Measured and Estimated) 4

Fig. 11. Observer Performance. External disturbances acting with the 2


system set in open loop. The half of the system inertia is taken into 0.67 0.68 0.69 0.7 0.71 0.72
account in order to have a correct transducer toque measurement.
(a) Transient

VII. CONCLUSION

A speed and disturbance torque observer based on


1.6 -
1.55 -
mAverage
mPPR
discrete time Kalman filter for the mechanical part of
electrical machines has been presented. The incorporation
of a simple hardware adds new information reducing
considerably the measurement noise covariance and
increasing the observer gain. This estimator improves the
dynamic performance and stability upon cancelling the
encoder nonlinearity. In the ultra low speed range
undesirable oscillations are practically eliminated.

REFERENCES

T. Ohmae, T. Matsuda, K. Kamiyama, and M. Tachikawa, “A


microprocessor-controlled high-accuracy wide range speed regulator
for motor drives,” IEEE Trans. Ind. Electronics. E-29, pp. 207-211,
Aug. 1982.
1.1

0.49
I

0.5
I

0.51 0.52
I
512 PPR

0.53 0.54
1
Y. Hori, “An instantaneous speed observer for high performance
control of DC servomotor using DSP and low precision shaft (b) Zoom at low speed
encoder”, Proc. EPE, 1991, vol. 3, pp. 647-652
Y. Hori, “Robust and adaptive control of a servomotor using low
precision shaft encoder”, Proc. IECON’93 vol. 1, pp. 73-78 Fig. 12. Estimated and M/T average speed.

545

Authorized licensed use limited to: Reva Institute of Tehnology and Management. Downloaded on December 14, 2008 at 00:31 from IEEE Xplore. Restrictions apply.

You might also like