Sensor Fusion for Linear Motors, an Approach for Low

Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002
SENSOR FUSION FOR LINEAR MOTORS,
AN APPROACH FOR LOW-COST
MEASUREMENTS
Bas J. de Kruif, Bastiaan van Wermeskerken,
Theo J. A. de Vries and Maarten J. Korsten
University of Twente, Drebbel Institute for Mechatronics,
P.O. Box 217, 7500 AE Enschede, The Netherlands
for information please email: [email protected]
Abstract
A new measurement setup for a linear motor is investigated. It is custom
to use an optical ruler as a measurement device for a linear motor. The
high position measurement accuracy that is obtained with this ruler, is
required to get an accurate estimate of the velocity to be used in the
velocity feedback loop. The accuracy is not required for the position
feedback loop.
An optical ruler is an expensive measurement device and because the
accuracy is higher than needed for the position measurement, it could be
advantageous to use a cheaper sensory system to measure the position
and to use auxiliary sensors to get a good estimate of the velocity.
The permanent magnets that are inherently present in a synchronous PM
motor can be used as a coding such that no external ruler is necessary.
Hall sensors are used to measure the magnetic field of these magnets
and determine the position based on this magnetic field. The velocity
estimate derived from this measurement does not meet the specifications
and therefore an acceleration sensor is added. The acceleration sensor
in combination with the position sensors estimate the velocity with an
accuracy that meets the specifications for a considerably smaller price
than the optical ruler.
1 Introduction
Linear motors are typically used in applications that require high speed, high force
and high precision actuation. The high precision, i.e. position accuracy, can only be
achieved if good measurements are present for the feedback. For fluent control a good
estimation of the position is not enough and a good velocity estimate is also needed. It
is common to use an optical ruler to measure the position (Gieras & Piech 2000). The
velocity is not actually measured but calculated from the position measurement. This
velocity estimation uses differentiation and is therefore noise sensitive. High quality
position measurements are needed to get satisfactory velocity estimates. Typically, the
deciding factor in selecting a position sensor for a linear motor is the resolution that is
554
Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002
required in order to obtain a sufficiently good velocity estimation, and not the accuracy
that is required for the position feedback loop.
An optical ruler is an expensive measurement device and it would be economically
attractive to replace it with a less costly substitute. The positional accuracy of the
substitute may degenerate for the control of the motor, however, the quality of the
velocity estimation may not decrease. The required accuracy, the distance between the
measured quantity and the true quantity, is given to be 5 µm for the position estimate
and should be accurate within 1.7 mm/s for the velocity estimate. In this paper, we
propose such a measurement system.
This paper is organized as follows. In section 2 the background of the method is
treated. The concepts by which we try to substitute the optical ruler are given here
including some theory. In section 3 the requirements placed on the hardware are discussed. With the new measurement setup a set of experiments is performed. These
experiments are treated in section 4. Finally a conclusion is drawn in section 5.
2 Background
Optical rulers can be used to obtain a good position measure and based on this measurement a velocity estimate can be deduced. An optical ruler consists of two parts:
1. a ‘strip’ with some form of coding that can be read with optical means
2. a ‘reader’ that measures position by reading the coding of the strip
High accuracies are achievable with such systems. However, for medium accuracies, a ruler is relatively expensive, due to the fact that the cost price for an optical
reader is high and because a specific strip with accurate coding always has to be added
to the motion system. It is constructional unattractive to include a strip in the motion
system. In order to substantially lower the costs, we should look for a measurement
system based on much cheaper hardware. This may be realized by considering solutions that meet the following principles:
1. functional interaction: measure motion characteristics on basis of inherently
present actuator properties instead of using a separately added measurement device.
2. sensor fusion: measure motion characteristics with multiple low cost devices
instead of one costly device
Function interaction: We wish to combine the inherently present actuator properties
for the estimation of the position. The most obvious choice is to use the magnets that
are present for the generation of a force as a coding. The magnetic field can be related
to the position of the translator.
Sensor fusion: We want to combine several magnetic field measurements to one position estimate with a higher accuracy than a single sensor can achieve. Secondly, we
want to fuse this position estimate with an acceleration measurement to get a velocity estimate. All these combinations are done at a signal level and it is therefore called
signal-level sensor fusion (Lou & Kay 1992). This two-stage fusion scheme is depicted
in figure 1. In this figure the block SF measures the position from several magnetic field
measurements and the block K estimates the states from the position and acceleration
measurement.
555
Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002
X1
X2
X3
SF
x̂
Xn
xˆˆ
K
a
aˆˆ
vˆˆ
Figure 1: Sensor fusion scheme for estimation of the states
2.1
Position measurement
The position is measured by a combination of functional interaction and sensor fusion.
If only one Hall sensor is used to measure the magnetic field of the permanent magnets,
the spatial sensitivity might be too low in certain regions, and therefore several magnetic field sensors can be used. The combination of these measurements is the sensor
fusion part.
The spatial sensitivity of one Hall sensor that can measure the complete range variation of the magnetic field might be too low to obtain the required positional accuracy
as stated before. The spatial sensitivity is given as the derivative of the output of the
Hall sensor relative to the position. The output of one sensor as function of the position
is given in figure 2. The location of two magnets is included in this figure. The spatial
sensitivity is zero at the top and the bottom of the sine because the tangent is horizontal. If an AD-card is used to read the output, the position range that corresponds to this
digital value would be large compared with other positions. Should the Hall sensor be
moved closer to the magnets, the output will saturate. Both unsaturated and saturated
sensor outputs are given in figure 2. It can be seen that the spatial sensitivity is larger
for the saturated sensor if it is not saturated.
If we use multiple sensitive Hall sensors that saturate most of the time but that are
located in such a way that there is always one out of saturation, we are able to increase
the spatial sensitivity as much as desirable. This is illustrated in figure 3. In this figure
it can be seen that if several sensors are used, the spatial sensitivity is nearly equal
in the complete domain. The numbers in this figure denote the sensor number. The
number of required Hall sensors for the given accuracy will be calculated in section 3.
To obtain an estimate of a position based on the strength of the magnetic field,
the magnetic field should be known as function of the position. If all the magnets
are the same and their position relative to each other is equal, the position can be
calculated by the strength of the magnetic field and the number of magnets that are
passed. However, there is some tolerance on the magnet strength and their placement
which is unknown. This tolerances don’t need to introduce new inaccuracies. The
output of the sensor can be stored in a table as function of the position during an
identification phase. By comparing an output with the stored outputs and by including
the number of passed magnets, the position can be determined. The tolerances on the
spacing and the strength are incorporated in the table and shall only give small errors
due to interpolation between measured values.
2.2
State estimate
The set of Hall sensors gives a measurement of the position. This measurement can
be combined with an acceleration measurement to get an estimate of the velocity. This
556
output ma
x
Hall output
Hall output
Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002
output ma
1
2
3
4
output min
N
S
x
output min
N
position
Figure 2: The sensor output as a function
of the position at different distances to
the permanent magnets
S
position
Figure 3: The output of several sensors
close to the permanent magnets and displaced relative to each other
combination is depicted with the block K in figure 1.
The combination of measurements to obtain non-measured, but dependent, variables can be done using a Kalman filter (Ljung 1999). To obtain an estimate of nonmeasured variables, the Kalman filter includes an internal model of the system. The
measurements of the variables are compared with the states of this model and the states
of the internal model are updated depending on the variances on the measurements and
the predicted variance of the model states. The discrete internal model of the Kalman
filter is given in state space by:
x(k + 1) = A(k)x(k) + B(k)u(k) + w(k)
z(k) = C(k)x(k) + v(k)
In this equation the x is the state vector, the u the control vector, the z is the output
vector, w is the system noise and v is the measurement noise. The noise sources are
assumed to be white. If this is not true the noise can be coloured using augmented
states. The covariance matrix of the system noise equals E{ww T } = Q while the
covariance matrix of the measurement noise is given as E{vv T } = R. The crosscovariance matrix between these is assumed to be zero.
The error covariance matrix is denoted by Pee . This is the variance of the difference
between the state and the measurements. With this internal model a prediction can be
made for the next state and the next error covariance. This one-step ahead prediction is
given as:
x(k|k − 1) = A(k − 1)x(k − 1|k − 1) + B(k − 1)u(k − 1)
Pee (k|k − 1) = A(k − 1)Pee (k − 1|k − 1)AT (k − 1) + Q(k − 1)
The estimated state vector is a combination of the predicted state vector based on
the internal model and the measured state vector. The Kalman gain matrix M gives a
measure for the difference in uncertainties in predicted and measured state vectors, that
is based on the innovation matrix S. S is a measure for the total uncertainty:
S(k) = C(k)Pee (k|k − 1)CT (k) + R(k)
M(k) = Pee (k|k − 1)CT (k)S−1 (k)
557
Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002
If a new measurement, z̄, becomes available, the states and the error matrix are updated
as follows
x(k|k) = x(k|k − 1) + M(k) (z̄(k) − C(k)x(k|k − 1))
Pee (k|k) = Pee (k|k − 1) − M(k)S(k)MT (k)
The internal model that is used in the Kalman filter is a kinematic model. The
knowledge that is inserted is that the derivative of the position is the velocity and the
derivative of the velocity is the acceleration. A physical model is not used to increase
the portability. The measurement should give results according to its specifications for
each mass independent of the setup that is used. The inclusion of model knowledge
will improve the accuracy. The discrete internal model is given as:




0
1 Ts 12 Ts2
1 0 0
Ts  , B =  0  , C =
A= 0 1
0 0 1
0
0 0
1
Note the matrix B which consists of only zeros. This is done because the control
signal is assumed to be unknown. If the desired acceleration is present from the reference profile, this can be used in the input matrix B. But in our case we assume not to
posses this knowledge. This results that for this model all alterations in accelerations
are due to the system noise. The covariance matrix Q should get such a value that the
filter can react fast enough on changes. The value of this matrix is determined in the
next section by simulation.
The covariance of the final estimate depends on the variance of the measurements
and thus on the chosen sensors. The accuracy of the position has to be 5 µm while the
velocity should be estimated within the 1.7 mm/s of the true value. These specifications
state that the maximum absolute error is bound. However, the noise sources and the
covariance matrices are given as variances. With a given variance, a bound on the
absolute error can never be given with absolute certainty. Therefore we interpret the
given specifications such that the standard deviation of the accuracies should be below
the given values. To estimate the variance allowed on the sensors that will give this
accuracy, a set of simulations is performed.
3 Hardware requirements
In the previous section it was shown how the different sensor signals were combined
to get an estimate of the position and the velocity. In this section the requirements on
the hardware are determined. First the allowable variances of the measurement signals
that serve as input of the Kalman filter are determined. The position that is used by the
Kalman filter is also the combination of several Hall sensors. In the second part of this
section the number of required Hall sensors is calculated.
3.1
Variances
Unfortunately all sensor outputs are corrupted with noise. In this section we shall determine how large the variance of the noise on the output of the position and acceleration
measurement are allowed to be such that the estimated position and velocity is still
accurate enough.
The variance of the estimated variables is calculated for a set of different variances
on the measured variables. The variance of the estimation is determined by calculation
558
Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002
the error covariance matrix Pee in steady state which can be done using the Riccati
equations. The variances of the estimated variables are the diagonal elements of this
matrix.
The standard deviation of the position estimation is given in figure 4 and the standard deviation of the velocity estimation is given in figure 5. In these figures the standard deviation is plotted as function of the standard deviation of the acceleration measurement. This is done for several values of the standard deviation of the position
measurement. The horizontal line denotes the required accuracy. The exchangeability
between variance on the position and acceleration measurement can be observed.
The calculations are made in the steady state situation. The variance on the sensors
is chosen well below the required value. The choice of the sensor variances is given by
the diamond in the figures. This is done to play it save and because no control signal is
included in the model so the sensors should have to give good measurements to follow
fast changes. The cost of the sensors is kept in mind while making this choice. The
standard deviation on the measurement is given by:
σx̂ = 5 · 10−6
σa = 3.2 · 10
−2
[m]
[m/s2 ]
This will result in a steady state deviation of:
σx̂ˆ = 8.3 · 10−7
σv̂ˆ = 6.6 · 10
−5
[m]
[m/s]
With these variances the matrix R is given as:
2.5 · 10−12
0
R=
.
0
10−3
Next to the calculation of the matrix R the matrix Q should be given a value.
This has nothing to do with the hardware selection, but it can be determined during
the same simulations for the testing of the measurement setup. This matrix gives the
variances on the system noise. Only the acceleration is influenced by the system noise
and therefore only the (3,3)-element of this matrix has a value unequal to zero. The
change in acceleration is only due to the system noise because the control signal was
not available for the internal model. This means that the system noise should be chosen
such that this noise is capable of driving the model to the same accelerations as the
physical system. If the system noise is chosen too small, the filter will not be capable
to estimate the position fast enough and a phase lag will occur. On the other hand, if
this value is too high, the noise of the acceleration sensor will not be filtered and is
assumed to be the true value of the acceleration. A compromise has to be found.
Through simulations the variance of the system noise is determined. The motion
that was performed consisted of several sines such that the maximal acceleration was
100 m/s2 while the maximum velocity was 2 m/s. A reasonable compromise between
phase lag and noise was to set the variance on 100.
With the given matrices a set of simulations was performed to test if the determined
co-variance matrices gave the correct behaviour. The first simulation was to estimate
the velocity and the position while standing still. Both estimations were located for
most of the time within their predicted standard deviation, as expected. The second
simulation was a simulation were the acceleration and the velocity of the motion were
at their maximum value of 2 m/s and 100 m/s2 . In this case the maximal error in the
559
PSfrag replacements
PSfrag replacements
Proc. of Mechatronics
2002, University of Twente, 24-26 June 2002
10−4
10−2
−3
10
σ x̂ =
−4
10
σ x̂ =
−5
10
σ x̂ =
−6
0
5·1
=
σ x̂
10−6
3
−
10
10−3
=
σv̂ˆ[m/s]
σx̂ˆ [m]
10−5
σ x̂
6
−
10
10−4
=
−6
σ x̂ = 10
10−7
10−3
10−2
10−1
σa [m/s2 ]
100
σ x̂
101
10−5
10−3
10−2
10−1
σa [m/s2 ]
100
101
Figure 4: The standard deviation of the po- Figure 5: The standard deviation of the position estimate for different set of sensors sition estimate for different set of sensors
velocity estimate was (10−2 m/s). The estimation lagged behind and this also resulted
in large position errors (36 µm). This error occurred at the highest jerk. If the jerk was
limited to remain within 250 m/s3 the specifications were met. It should be noted that
the velocity estimation of the present controller gave worse results.
3.2
Number of Hall sensors
The position measurement x̂ is the result of combining the outputs of the Hall sensors.
Several Hall sensors are used for this measurement. If the sensors are placed close
to the magnets, they are saturated most of the time, but if they are not saturated, the
position sensitivity is high. This was already illustrated in figure 3. The closer the
sensors are placed by the magnets, the larger the position sensitivity and the shorter the
time they are out of saturation.
In this paragraph the number of sensors is calculated to achieve the required resolution of 5 µm. The number of sensors depends on the noise of the sensors and the
number of bits used in the AD-card. If no noise is present on the sensor output, any
resolution could be achieved if enough bits were used for the conversion. However
noise is present and it should not introduce errors that are larger than 5 µm for each
position of the motor.
The output of one Hall sensor can be written as:
2πx
y = 2.5 sin
+ [V]
p
in which p is the pitch of the magnets and is the noise that is measured to have
a standard deviation of 600 µV. The x is the displacement and the amplitude of the
output was 2.5 V. The worst spatial sensitivity occurs right above a magnet because the
tangent is horizontal there (fig. 2). To estimate the position within 5µm the deviation
to the right or the left is only allowed to be 2.5µm. By moving 2.5 µm to the right we
find a change of the output of
π
2π2.5 · 10−6
∆y = 2.5 − 2.5 sin
= 2.1 [µV]
+
12 · 10−3
2
The standard deviation of the sensor is 600 µV while a change of 2.1 µV gives already
rise to a deviation of 2.5 µm. It is clear that the output noise is too large and a larger
spatial sensitivity is required.
560
Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002
If two sensors are used that are out of saturation successively, the output of these
can be given by:

√
 2.5 2 sin 2πx
[V]
if |y1 | ≤ 2.5
p
y1 =
 2.5sign sin 2πx
otherwise
[V]
p

√
 2.5 2 sin 2πx + 1π
[V]
if |y2 | ≤ 2.5
2
p
y2 =
 2.5sign sin 2πx + 1π
otherwise
[V]
p
2
The worst sensitivity occurs if one of the sensors is just out of saturation or is just about
to enter. A deviation of 2.5 µm would result in a change in the output of:
√
2π2.5 · 10−6
3π
∆y1 = 2.5 − 2.5 2 sin(
+
) = 3.2
12 · 10−3
4
[mV]
So in the worst position of the motor, a change in position of 2.5 µm correspond to
a change in the output signal of 3.2 mV. This is about 5 times the standard deviation
of the sensor noise, and it is therefore unlikely that the sensor noise will introduce
measurement errors that are larger than 5 µm.
The AD-card should be able to detect the changes of 2.5 µm and should therefore
have a maximal quantization step of 3.2 mV and have a reach from 0 to 5 V. This
requires a minimum of 11 bits.
A set of two Hall sensors read by AD card with 11 bits should be enough to measure
the position within 5µm. However, to play it save and to increase the accuracy, four
sensors are used with 12-bits AD-converters.
4 Experiments
Several experiments were performed on a linear motor that is present in our laboratory.
This motor was extended with four Hall sensors that were displaced relative to each
other for the measurement of the magnetic field such that one was always out of saturation. Furthermore, two acceleration sensors were mounted on the motor. One was
mounted on the moving part while the other was mounted on the stationary part. All
these signals were read by a computer through a 12-bit AD-card at a sample frequency
of 4 KHz.
Three experiments were performed. The first was the estimation of the position
and the velocity while standing still. The second was the estimation of the position
and the velocity at a constant velocity of 1 m/s and the third was the estimation while
accelerating at 5 m/s2 . These experiments were performed in closed loop and the
used measurement device for the feedback was still the optical ruler that was already
present in the setup. The optical ruler is also used as the ‘true’ value of the position
for comparison reasons although it has a time delay. The position and the velocity
estimation based on the acceleration measurement and the Hall outputs was done by
the gathered data off-line. The estimation of the variables was done as if the data came
in per sample and no techniques were used that could not be used in a real-time setting
like anti-causal filtering.
First a set of experiments were performed to estimate the time delays in the system
and the sensor biases. These estimates were used to compensate for these effects while
estimating the position and velocity.
561
Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002
Position error [m]
5
×10−6
PSfrag replacements
Velocity error [m/s]
PSfrag replacements
2.5
0
-2.5
-5
0
0.1
2
1
0
-1
-2
0.2
×10−3
0
time [s]
×10−5
PSfrag replacements
Velocity error [m/s]
Position error [m]
2
1
0
-1
-2
0
0.05
0.2
Figure 7: Steady state estimate error
Figure 6: Steady state position error
PSfrag replacements
0.1
time [s]
3
1.5
0
-1.5
-3
0.1
time [s]
×10−3
0
0.05
0.1
time [s]
Figure 8: Position estimate error while Figure 9: Velocity estimate error while
moving with constant velocity
moving with constant velocity
The error in the position estimate and the velocity estimate in the steady state case
are given in figure 6 and 7. The bias in the position estimate is 3.3 µm while the
standard deviation is only 0.6 µm. The bias in the velocity estimate is 0.7 mm/s while
the standard deviation is 0.13 mm/s. These biases are introduced by a bias in the
acceleration measurement. The steady state estimation stays within the specifications.
The error in the position and velocity estimate while moving with a constant velocity are given in the figures 8 and 9. It can be observed that a periodic error is present,
with a period corresponding to the magnet spacing. This effect is assumed to originate
for differences in time delays. Next to the periodic error, the bias of the acceleration
sensor can still be observed. The specifications are almost met.
The error in the position and velocity estimate while moving with a constant acceleration is given in the figures 10 and 11. The same periodic error as with the constant
velocity can be observed. The amplitude of this error grows as the motor is moving
faster which can supports the hypothesis that the periodic error is introduced by due to
time delays, but it can also be contributed to the magnetic field generated by the motor
coils. The specifications are not met, although it is close.
562
Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002
Position error [m]
2.5
×10−5
PSfrag replacements
Velocity error [m/s]
PSfrag replacements
1.25
0
-1.25
-2.5
0.05
0.1
4
×10−3
2
0
-2
-4
0.05
0.15
time [s]
0.1
0.15
time [s]
Figure 10: Position estimate error while Figure 11: Velocity estimate error while
moving with constant acceleration
moving with constant acceleration
5 Conclusions
In this paper a method is presented that uses functional interaction and sensor fusion to
estimate the position and the velocity of a linear motor. This measurement setup makes
it possible to omit the expensive optical ruler and use low cost acceleration sensors
and Hall sensors. By using the magnets that are already present in the linear motor to
generate the driving force no ruler has to be placed next to the motor which makes this
setup constructual attractive.
The specifications were met in the steady state case, slightly missed while moving
with a constant velocity of 1 m/s and not met while accelerating with constant acceleration. However it is a most promising technique for the replacement of the optical
ruler.
It is expected that the performance can be easily increased such that it will meet the
specifications if the time delays are compensated for as for the motor currents.
References
Gieras, J. & Piech, Z. (2000), Linear Synchronous Motors, Transportation and Automation Systems, CRC Press, Boca Raton, Florida.
Ljung, L. (1999), System Identification, Theory for the user, PTR Prentice-Hall information and system sciences series, 2nd edn, Prentice-Hall PTR, Upper Saddle
River, New Jersey.
Lou, R. & Kay, M. (1992), Data Fusion in Robotics and Machine Intelligence, Academic Press, Inc., chapter Data Fusion and Sensor Integration: State-of-the-art
1990’s, pp. 7–135.
563