Periodic Control Systems — PSYCO 2010 Antalya, Turkey, August 26-28, 2010
Combined Approach Helping to Reduce Periodic Disturbances in Speed Measuring ∗ ˇ Pavel Ettler ∗ Ivan Puchr ∗ Jiˇ r´ı Stika ∗
COMPUREG Plzeˇ n, s.r.o., 306 34 Plzeˇ n, Czech Republic (e-mail:
[email protected])
Abstract: Speed measurement counts among ordinary sectional tasks connected with control or monitoring of many industrial processes. Incremental rotary encoders represent widespread devices which, together with corresponding electronics, provide sufficient accuracy and reliability in most cases. Mechanical arrangement of the complete measuring device then determines overall accuracy of the speed measurement. Nevertheless, there exist applications where even a relatively low error of the encoder itself cannot be neglected. Periodic character of related disturbances can help in solving the problem of reduction of their impact on the measurement accuracy. Solution provided in the paper combines two approaches to provide corrected signal. Motivation of the work comes from the field of control of cold rolling mills. Keywords: Speed measurement, disturbance rejection, periodic signal, smoothing filters 1. INTRODUCTION Many industrial processes include moving parts, either belonging to the machinery or related to the product being processed, the speed of which is required to be measured. In case of continuous speed measurement of a strip made from metal, paper or another material, linear movement is often transformed into the rotary one thanks to a roll or roller connected to an incremental rotary encoder. The roll, its bearing, coupling of its shaft with the shaft of the encoder and the encoder itself create a measurement unit, properties of which determine accuracy and reliability of the speed measurement.
be corrected subsequently, e.g. by application of proper filtering. Nevertheless if the quest to improve the signal concerns even small relative errors, quality of the encoder should be taken into consideration. The above mentioned problem has arisen for speed measurement of a metal strip processed on a reversing cold rolling mill. Strip speed is usually measured by means of incremental optical rotary encoders coupled with deflection rolls on both sides of the rolling mill as illustrated in Fig. 1. Precise information about ratio of strip speeds on the input and output sides of the mill (depending on direction of rolling) is crucial for a specific kind of strip thickness control (see e.g. Ettler and Andr´ ysek (2007)). Solution of the problem can help to avoid investments into expensive laser velocimeters which are being used in such cases. 2. SPEED MEASUREMENT BY AN INCREMENTAL ROTARY ENCODER
Fig. 1. Example of speed measurement: incremental rotary encoder coupled with the deflection roll of a smallsized cold rolling mill.
An incremental rotary encoder usually provides several signals for further processing. The most important for our considerations are two outputs A & B called quadrature outputs the wave forms of which are 90 degrees (π/2 rad) out of phase - see Fig. 2. The phase shift enables to determine direction of rotation. In addition to the quadrature outputs the encoder usually provides a separated signal with one reference pulse per revolution. Number n of A & B counts per revolution is a basic parameter of the encoder; 1024 pulses per revolution is one of typical values.
For applications where information about the speed is utilized for precise control of some kind, the signal should be subjected to further examination. Undesired variations of the measured signal often point to the need of mechanical revision of the measurement device. If mechanical cause of the problem cannot be solved entirely, the signal should
The position information is obtained by counting the individual increments (measuring steps) from some point of origin. Speed information can be either derived from number of counted increments per time unit or, for more precise speed measurement, from measurement of width of the increment pulse as depicted in Fig. 3. The latter principle utilizes externally generated fast pulses the counting of which is triggered by the increment pulse. Number of
ISBN 978-3-902661-86-9/11/$20.00 © 2010 IFAC
1
counted fast pulses np is proportional to the width w of the increment pulse and thus inversely related to the angular velocity ω. Thus for time instants k which are in our case determined by trailing edges of the increment pulse A or B we get Cp ω(k) = , (1) np (k)
more complicated when frequencies of spurious periodic components fall into the range of frequencies given by periodic speed variations related to real speed changes. This is the case for cold rolling mills where periodic failures can be misinterpreted e.g. as periodic speed fluctuations caused by working roll eccentricity. Thus, mere application of some kind of the band rejection filter is not appropriate in this case. Particular causes of periodic disturbances must be inspected instead. Refining the scale of our investigation we come to the level where the encoder’s imperfections are comparable with those coming from the mechanical parts.
where constant Cp depends on the frequency f of an external fast pulse generator. To obtain ω(k) in radians per second the constant can be expressed as πf Cp = , (2) n
3. INITIAL EXPERIMENT
where in our case f = 25 MHz, n means A counts per revolution and counting of np (k) is active for half of the period of the A pulse (see Fig. 3).
To illustrate the problem let us accomplish a simple experiment. The rotary encoder is fixed at a specific height above the ground and a fine string winded on its shaft is connected to a drop weight. Thanks to gravitation, the weight moves downwards unreeling the string and thus rotating the encoder’s shaft. Plot of the speed derived from encoder’s pulses should be a smooth curve reflecting an accelerated motion moderated by bearing friction. However, the real speed progress include periodic disturbances as shown in the upper plot in Fig. 4. At this point, it is impossible to distinguish between disturbances caused by imprecise graduation within the encoder and irregular friction of encoder’s bearing.
Peripheral speed and thus speed of the moving strip can be calculated as d v(k) = ω(k) , (3) 2 where d stands for diameter of the measuring (deflecting) roll. A B
Knowledge of the distribution of deviation per revolution can help to correct the speed signal to some extend. We can subtract the deviations derived either from the preceding revolution or the average of many previous revolutions (both having their advantages and drawbacks) from the actual measurement to get slightly improved signal - lower plot in Fig. 4. However, the deviation to be extracted (Fig. 5) depends on the actual speed and the method does not cope well with irregularities which can be seen around the 12000th sample in Fig. 4. Moreover, using this method we are filtering out frequencies which should be preserved in the signal.
Fig. 2. Quadrature outputs A & B of an incremental rotary encoder. A
wA
cA
Fig. 3. Width wA of the pulse A is proportional to number of fast pulses cA generated externally and counted within duration of the increment pulse.
It is obviously difficult to obtain an ideal source of uniform rotational motion. To provide at least some reasonable standard for repeatable trials, further experiments were accomplished on an improvised test bed consisting of a turntable with an additional flywheel, an optical rotary encoder, a shaft coupling and a fixing arm. Combinations of several types of mentioned components were examined to get a stable test arrangement.
Encoders with optical scanning incorporate measuring standards of periodic structures known as graduations. These graduations are applied to a carrier substrate of glass or steel. The optical encoders operate using the principle of photoelectric scanning of a measuring standard. The accuracy of graduation lines depends on the encoder type ranging from ±20 to more than ±100 angular seconds. There exist also other causes of encoders errors, depiction of which can be found in e.g. Yien (1992). Advanced speed measurement algorithms can be found in Petrella et al. (2007) or Liu (2002).
4. SIGNAL FILTRATION AND CORRECTION Character of the periodic disturbances on the speed signal seems to lead to a simple solution: let us engage proper filtering, e.g. some FIR filter or the moving average (MA) filter the window of which corresponds to number of samples (i.e. number of increment pulses n) per revolution:
An industrial speed measuring device consists of several mechanical parts (the roll, shaft coupling, encoder, etc.) whose imperfections contribute to deterioration of the speed signal. Eccentricity of the measuring roll, radial misalignment and radial error between the roll’s and encoder’s shafts, imperfect bearings - all these faults present themselves in periodic speed deviations. Significant failures of such types can be easily detected e.g. by the means of the Fast Fourier Transform (FFT). The problem becomes
ωMA (k) =
n−1 1X ω(k − i) , n i=0
where ωMA (k) is output of the MA filter in time k.
2
(4)
where p1 (k), p2 (k) are coefficients of the polynomial in time k.
4.8 w [rad/s]
4.6 4.4
The TP filter reduces time delay between filter output and the original signal. Outputs of the MA and TP filters can be seen in Fig. 6.
4.2 4 3.8
3.72
4000
6000
8000
10000 12000 14000 16000
3.7 w [rad/s]
2000
4.8 [rad/s]
4.6
3.66 3.64
4.4
3.62
4.2
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
2.2 4
4
w
c
3.68
x 10
3.8 4000
6000
3.676
8000 10000 12000 14000 16000 Sample number
3.674 w [rad/s]
2000
Fig. 4. Upper plot: angular velocity ω (thin line) in radians per second of the encoder’s shaft during the ’pull of gravity’ experiment. Ideal velocity is represented by the thick smooth line in both graphs. Lower plot: sligtly corrected speed signal ωc (thin line) resulting from subtraction of known deviation of pulse numbers.
3.664 0.2
[rad/s] Dw
0 −0.2
pi/2
pi Angle [rad]
3/2pi
0.4
0.6
0.8
1
1.2 1.4 Sample number
1.6
1.8
2
2.2 4
x 10
Fig. 6. Comparison of outputs of the MA (moving average) and TP (trend preserving) filters. Upper plot: outputs of both filters (smooth thick line) are similar in the scale of the original signal. Lower plot: output of the TP filter (thick line) is less delayed and less dumped then output of the MA filter (thin line).
0.2
0
3.67 3.668 3.666
0.4
−0.4
3.672
To exclude influence of potentially imperfect encoder’s bearing, let us investigate encoder’s A & B signals, or to be more specific, widths of A & B pulses. Fig. 7 shows differences in widths of increment pulses A & B by the means of ratios
2pi
Fig. 5. Average differences (thick line) of the angular velocity per revolution for the initial experiment. Differences for several particular revolutions are illustrated by dotted lines.
rA (j) = wA (j)/w ¯A ,
Common drawback of MA and ordinary FIR filters consists in the fact that they imply time delay. As the speed signal is primarily intended for real-time control, time delay of the filtered signal should be minimized. Moreover, we would like to preserve speed dynamics in the range as wide as possible. That is why we are looking for a combination of a filter with minimal time delay and some kind of zero-delay signal correction based on information about preceding deviations.
rB (j) = wB (j)/w ¯B ,
(7)
where index j = 1, . . . , n points to particular sector of a circle (contrary to the above introduced index i which is related to the actual time instant k); w ¯A , w ¯B are mean values of pulse widths per revolution and pulse widths wA , wB are measured by the means of external fast pulses as depicted in Fig. 3. Phase shift between A and B pulses is neglected in this case. Different shapes of curves for A & B channels in Fig. 7 can be clearly distinguished indicating inaccuracy of their graduation lines. The shapes differ for particular cases and correction based on their subtraction (Fig. 4) cannot be considered as an universal tool.
An interesting alternative to the moving average was found in the moving polynomial fitting of vector Ω(k) of the last n data samples Ω(k) = {ω(k − n + 1), . . . , ω(k)} (5)
On the other hand, ratios of widths of corresponding couples A & B are constant for a concrete encoder. For the entire encoder’s revolution the vector of pulse width ratios can be expressed as wA (1) wA (n) RAB = {rAB (1), . . . , rAB (n)} = ,..., .(8) wB (1) wB (n)
in a least squares (LS) sense. The polynomial p(k) evaluated for each k can be reduced to the first order to provide linear approximation of Ω(k), i.e. to represent the trend of last n data samples. Output ωTP (k) of such trend preserving (TP) filter can be set equal to the last point of the approximation line segment ωTP (k) = p1 (k)n + p2 (k) (6)
It should hold for an ideal encoder that RAB ≡ 1 for all instants of j. It is not the case for a real encoder primarily due to irregularities of its graduation lines. In our case
3
external pulses and can be influenced by potential division (dilution) of increment pulses or by changing of f .
1.015 1.01
rA
1.005
As a result, we get an improved angular velocity ωI (k) as the sum of filter output ωTP (k) (6) and corrector output ωC (k) = ωC (k − 1) + ∆ω(k):
1 0.995 0.99
ωI (k) = ωTP (k) + ωC (k) 0
pi/2
pi Angle [rad]
3/2pi
pi Angle [rad]
3/2pi
Fig. 10 shows the raw and corrected signal of angular velocity. The clearly arisen periodic component in the resulting signal is caused by slight radial misalignment of the encoder’s and turntable’s shafts. Note that measurement error caused by encoder’s irregularities had masked real speed fluctuations which could lead to a false consideration that the corrector implies a time delay which is not the case here.
1.015 1.01
rB
1.005 1 0.995 0.99 0
pi/2
2pi
8.55 8.5 w [rad/s]
Fig. 7. Different shapes of pulse width variations expressed by ratios rA , rB for A & B channels respectively. RAB was calculated from several experiments with a result shown in Fig. 8. The speed-invariant vector RAB , once experimentally evaluated, can be used for correction of speed calculation.
8.45 8.4 8.35 2000
3000
4000
5000
6000
2000
3000
4000
5000 6000 Sample number
7000
8000
9000
10000
7000
8000
9000
10000
8.55
1.01 1.005
8.5 w [rad/s]
1 0.995 0.99
8.45
I
rAB
(10)
2pi
0.985 0.98 0.975 0
pi/2
pi Angle [rad]
3/2pi
2pi
Fig. 8. Ratio RAB of widths of the A & B encoder pulses as an invariable property of a particular encoder.
Fig. 10. Upper plot: raw signal of angular velocity ω. Lower plot: improved signal ωI as the sum of outputs of the TP filter and the corrector.
Actual ratio of widths of A & B pulses can be used for evaluation of actual speed variation: if the angular velocity around time k is constant, ratio wA (k)/wB (k) should be equal or close to the corresponding stored ratio rAB (j) where j = (k mod n) + 1. During acceleration, the pulses are being shortened and ratios become different as illustrated in Fig. 9. A
5. CONCLUSION Investigation of speed measurement led to consideration of measuring errors caused by tiny irregularities of an incremental rotary encoder. To minimize time delay inherent for ordinary digital filters and to preserve requested dynamic range, a combination of the simple signal filter and the signal corrector was introduced.
w (t) A
B
8.4 8.35
w (t)
Experiments made on an improvised test bed led to promising results of the method. The approach must be further elaborated and supplemented with suitable safety components to be applicable for real-time operation.
B
Fig. 9. Ratio of actual widths of the A & B encoder pulses is influenced by shortening of pulses during acceleration.
ACKNOWLEDGEMENTS
Phase shift between the A & B pulses, which we neglected for evaluation of rAB , is now useful for evaluation of increment of angular velocity wA (k) ∆ω(k) = − rAB (j) ∆t, (9) wB (k)
ˇ This work was partially supported by MSMT grants 7D09008 (ProBaSensor) and 1M0572 (DAR – Research Centre Data-Algorithms-Decision Making). REFERENCES
where j = (k mod n) + 1 and ∆t is time difference between adjacent data samples. Accuracy of the calculation depends on widths of A & B pulses and on frequency f of
Ettler, P. and Andr´ ysek, J. (2007). Mixing models to improve gauge prediction for cold rolling mills. In
4
Proceedings of the 12th IFAC Symposium on Automation in Mining, Mineral and Metal Processing. Qu´ebec, Canada. Liu, G. (2002). On velocity estimation using position measurements. In Proceedings of American Control Conference, ACC 2002. Anchorage, USA. Petrella, R., Tursini, M., Peretti, L., and Zigliotto, M. (2007). Speed measurement algorithms for lowresolution incremental encoder equipped drives: a comparative analysis. In Proceedings of International Aegean Conference on Electrical Machines and Power Electronics, ACEMP ’07. Bodrum, Turkey. Yien, C. (1992). Incremental encoder errors: Causes and ways to reduce them. In Proceedings of Int. Incremental Motion Conf, PCIM 92. N¨ urnberg, Germany.
5